-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: a bunch more work for docs/docs site/uprades based on creating …
…docs
- Loading branch information
Showing
135 changed files
with
3,143 additions
and
504 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export const Spacer = () => <div style={{ height: '2rem' }} /> | ||
interface Props { | ||
height?: string | ||
} | ||
|
||
export const Spacer = ({ height = '2rem' }: Props) => <div style={{ height }} /> |
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
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
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
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
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,70 @@ | ||
import dependencies from '#/input/geom-point/build/dependencies' | ||
import { CodeEditor } from '../../CodeEditor' | ||
import { additionalFiles } from './additionalFiles' | ||
|
||
const files = { | ||
'penguinsStyles.module.css': { | ||
code: `.header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
row-gap: 0.8rem; | ||
padding: 0.5rem 0.1rem 1rem 0.1rem; | ||
} | ||
.title { | ||
font-weight: bold; | ||
} | ||
.legend-title { | ||
font-weight: 600; | ||
font-size: 0.8rem; | ||
}`, | ||
}, | ||
} | ||
|
||
const src = `import { | ||
GG, Labels, BrushAction, LegendOrientation, | ||
} from '@graphique/graphique'; | ||
import { penguins } from '@graphique/datasets'; | ||
import { GeomPoint, Legend } from '@graphique/geom-point'; | ||
import styles from './penguinsStyles.module.css' | ||
const App = () => ( | ||
<GG | ||
data={penguins} | ||
aes={{ | ||
x: (d) => d.bodyMass, | ||
y: (d) => d.flipperLength, | ||
fill: (d) => d.species, | ||
}} | ||
margin={{ left: 45 }} | ||
isContainerWidth | ||
> | ||
<GeomPoint brushAction={BrushAction.ZOOM} /> | ||
<Labels | ||
header={ | ||
<div className={styles.header}> | ||
<span className={styles.title}>🐧 Palmer Penguins</span> | ||
<Legend | ||
orientation={LegendOrientation.H} | ||
title={<span className={styles["legend-title"]}>Species</span>} | ||
/> | ||
</div> | ||
} | ||
x="→ Body mass (g)" | ||
y="↑ Flipper length (mm)" | ||
/> | ||
</GG> | ||
);` | ||
|
||
export const Basic = () => ( | ||
<CodeEditor | ||
src={src} | ||
height={575} | ||
additionalDeps={dependencies} | ||
additionalFiles={{ ...additionalFiles, ...files }} | ||
showTabs | ||
/> | ||
) |
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,23 @@ | ||
import geom from '#/input/geom-point/build?raw' | ||
import dts from '#/input/geom-point/build/dts' | ||
|
||
const PKG = 'geom-point' | ||
|
||
export const additionalFiles = { | ||
[`/node_modules/@graphique/${PKG}/package.json`]: { | ||
hidden: true, | ||
code: JSON.stringify({ | ||
name: `@graphique/${PKG}`, | ||
main: './index.js', | ||
types: './index.d.ts', | ||
}), | ||
}, | ||
[`/node_modules/@graphique/${PKG}/index.js`]: { | ||
hidden: true, | ||
code: geom, | ||
}, | ||
[`/node_modules/@graphique/${PKG}/index.d.ts`]: { | ||
hidden: true, | ||
code: dts, | ||
}, | ||
} |
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 @@ | ||
export * from './Basic' |
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,54 @@ | ||
import dependencies from '#/input/geom-point/build/dependencies' | ||
import { CodeEditor } from '../../CodeEditor' | ||
import { additionalFiles } from './additionalFiles' | ||
|
||
const src = `import { | ||
GG, Labels, BrushAction, LegendOrientation, Theme, | ||
} from '@graphique/graphique'; | ||
import { penguins } from '@graphique/datasets'; | ||
import { GeomPoint, Legend } from '@graphique/geom-point'; | ||
const App = () => ( | ||
<GG | ||
data={penguins} | ||
aes={{ | ||
x: (d) => d.bodyMass, | ||
y: (d) => d.flipperLength, | ||
fill: (d) => d.species, | ||
}} | ||
margin={{ left: 45 }} | ||
isContainerWidth | ||
> | ||
<GeomPoint brushAction={BrushAction.ZOOM} /> | ||
<Theme | ||
animationDuration={300} | ||
font={{ family: 'monospace' }} | ||
grid={{ stroke: null }} | ||
axis={{ | ||
showAxisLine: true, | ||
stroke: 'dodgerblue', | ||
tickStroke: 'dodgerblue', | ||
tickLabel: { color: 'crimson' }, | ||
}} | ||
headerColor="crimson" | ||
legend={{ labelColor: 'dodgerblue' }} | ||
tooltip={{ groupLabel: { fontSize: '1.1rem' } }} | ||
/> | ||
<Labels | ||
header={ | ||
<Legend title="Species" orientation={LegendOrientation.H} /> | ||
} | ||
x="Body mass (g)" | ||
y="Flipper length (mm)" | ||
/> | ||
</GG> | ||
);` | ||
|
||
export const Basic = () => ( | ||
<CodeEditor | ||
src={src} | ||
height={530} | ||
additionalDeps={dependencies} | ||
additionalFiles={additionalFiles} | ||
/> | ||
) |
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,23 @@ | ||
import geom from '#/input/geom-point/build?raw' | ||
import dts from '#/input/geom-point/build/dts' | ||
|
||
const PKG = 'geom-point' | ||
|
||
export const additionalFiles = { | ||
[`/node_modules/@graphique/${PKG}/package.json`]: { | ||
hidden: true, | ||
code: JSON.stringify({ | ||
name: `@graphique/${PKG}`, | ||
main: './index.js', | ||
types: './index.d.ts', | ||
}), | ||
}, | ||
[`/node_modules/@graphique/${PKG}/index.js`]: { | ||
hidden: true, | ||
code: geom, | ||
}, | ||
[`/node_modules/@graphique/${PKG}/index.d.ts`]: { | ||
hidden: true, | ||
code: dts, | ||
}, | ||
} |
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 @@ | ||
export * from './Basic' |
Oops, something went wrong.