Skip to content

Commit

Permalink
feat(colors): disable diceRoll in the demo and update the chart preview
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed May 5, 2024
1 parent ff1e796 commit 7feed33
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions conf/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ capture:
# html is broken for now
# flavors: [svg, html, canvas]

- pkg: tree
chart: tree
flavors: [svg]

- pkg: heatmap
chart: heatmap
flavors: [svg, canvas]
Expand Down Expand Up @@ -125,6 +121,11 @@ capture:
chart: sunburst
flavors: [svg]

- pkg: tree
chart: tree
theme: dark
flavors: [svg]

- pkg: treemap
chart: treemap
flavors: [svg, html, canvas]
Expand Down
Binary file modified website/src/assets/captures/tree.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion website/src/components/components/ComponentTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface ComponentTemplateProps<
propertiesMapper?: (props: UnmappedProps, data: Data) => MappedProps
codePropertiesMapper?: (props: MappedProps, data: Data) => MappedProps
generateData: (previousData?: Data | null) => Data
enableDiceRoll?: boolean
dataKey?: string
getDataSize?: (data: Data) => number
getTabData?: (data: Data) => Data
Expand Down Expand Up @@ -70,6 +71,7 @@ export const ComponentTemplate = <
propertiesMapper,
codePropertiesMapper,
generateData,
enableDiceRoll = true,
dataKey = 'data',
getDataSize,
getTabData = data => data,
Expand Down Expand Up @@ -129,7 +131,9 @@ export const ComponentTemplate = <
data={tabData}
dataKey={dataKey}
nodeCount={getDataSize !== undefined ? getDataSize(data) : undefined}
diceRoll={data !== undefined ? diceRoll : undefined}
diceRoll={
enableDiceRoll ? (data !== undefined ? diceRoll : undefined) : undefined
}
>
{children(mappedProperties, data, theme.nivo, logAction)}
</ComponentTabs>
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const Tree = () => {
defaultProperties={defaults}
propertiesMapper={mapper}
generateData={generateLightDataSet}
enableDiceRoll={false}
image={image}
>
{(properties, data, theme, logAction) => {
Expand Down

0 comments on commit 7feed33

Please sign in to comment.