-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from code-hike/patch-children
Don't fail with `undefined` `children` in remark plugin
- Loading branch information
Showing
5 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"codehike": patch | ||
--- | ||
|
||
Don't fail with `undefined` `children` in remark plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const first = [ | ||
{ rich: 10, cost: 50, name: "readme" }, | ||
{ rich: 20, cost: 50, name: "static blog" }, | ||
{ rich: 40, cost: 50, name: "static docs" }, | ||
{ rich: 60, cost: 50, name: "interactive blog" }, | ||
{ rich: 75, cost: 50, name: "interactive tutorial" }, | ||
{ rich: 90, cost: 50, name: "landing page" }, | ||
] | ||
|
||
const second = [ | ||
{ rich: 10, cost: 10, name: "readme" }, | ||
{ rich: 20, cost: 18, name: "static blog" }, | ||
{ rich: 40, cost: 43, name: "static docs" }, | ||
{ rich: 60, cost: 56, name: "interactive blog" }, | ||
{ rich: 75, cost: 80, name: "interactive tutorial" }, | ||
{ rich: 90, cost: 95, name: "landing page" }, | ||
] | ||
|
||
const w = 300 | ||
const h = 200 | ||
|
||
export function Chart({ name }: { name: string }) { | ||
const points = name === "first" ? first : second | ||
// Scatter plot | ||
return ( | ||
<div className=""> | ||
<div | ||
style={{ width: w, height: h }} | ||
className="relative border-l-2 border-b-2" | ||
> | ||
{points.map(({ rich, cost }, i) => ( | ||
<div | ||
key={i} | ||
style={{ left: `${rich}%`, bottom: `${cost}%` }} | ||
className="absolute w-2 h-2 bg-blue-500 rounded-full" | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters