Skip to content

Commit

Permalink
docs(dataviz): add tree diagram demos, update network thumbnail (#2543)
Browse files Browse the repository at this point in the history
* docs(dataviz): add histogram

* docs(dataviz): add tree diagram demos, update network thumbnail
  • Loading branch information
theiliad authored Sep 13, 2021
1 parent 15246d9 commit 0175022
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 73 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@carbon/icons-react": "^10.38.0"
},
"dependencies": {
"@carbon/charts-react": "0.42.1",
"@carbon/charts-react": "0.48.0",
"@carbon/elements": "^10.42.0",
"@carbon/icons": "^10.38.0",
"@carbon/icons-react": "^10.38.0",
Expand Down
70 changes: 35 additions & 35 deletions src/components/data-visualization/ChartDemoGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ChartDemoGroup = ({ demoGroup, light }) => {
const DemoComponent = ChartComponents[demo.chartType.vanilla];

const numberOfRemainingDemos =
demoGroup.demos.length > 2 ? demoGroup.demos.length - 1 : 0;
demoGroup.demos.length >= 2 ? demoGroup.demos.length - 1 : 0;

const demoGroupClassification = demoGroup.type.replace('-chart', '');

Expand All @@ -40,47 +40,47 @@ const ChartDemoGroup = ({ demoGroup, light }) => {
)}

{light !== true && demo.description && (
<div className="bx--row">
<div className="bx--col-sm-4 bx--col-md-8 bx--col-lg-8">
<P className="dataviz-copy">{demo.description}</P>
</div>
</div>
)}

<div className="bx--row" style={{ marginTop: '1.5rem' }}>
<div className="bx--row">
<div className="bx--col-sm-4 bx--col-md-8 bx--col-lg-8">
<div
className="chart-demo-wrapper"
id={generateHeadingID(demo.title)}>
<div className="chart-demo">
<DemoComponent
data={demo.data}
options={demo.options}
style={{ maxWidth: 400 }}
/>
</div>
<P className="dataviz-copy">{demo.description}</P>
</div>
</div>
)}

<CodeBar
links={{
React: demo.codesandbox.react,
Angular: `https://carbon-design-system.github.io/carbon-charts/angular/?path=/story/${demoGroupClassification}-charts-${demo.id}`,
Vue: demo.codesandbox.vue,
Vanilla: demo.codesandbox.vanilla,
}}
<div className="bx--row" style={{ marginTop: '1.5rem' }}>
<div className="bx--col-sm-4 bx--col-md-8 bx--col-lg-8">
<div
className="chart-demo-wrapper"
id={generateHeadingID(demo.title)}>
<div className="chart-demo">
<DemoComponent
data={demo.data}
options={demo.options}
style={{ maxWidth: 400 }}
/>
</div>

<CodeBar
links={{
React: demo.codesandbox.react,
Angular: `https://carbon-design-system.github.io/carbon-charts/angular/?path=/story/${demoGroupClassification}-charts-${demo.id}`,
Vue: demo.codesandbox.vue,
Vanilla: demo.codesandbox.vanilla,
}}
/>
</div>
</div>
</div>

{numberOfRemainingDemos > 0 && (
<MiniCard
title={`${numberOfRemainingDemos} more demo${
numberOfRemainingDemos > 1 ? 's' : ''
}`}
href={`https://carbon-design-system.github.io/carbon-charts/?path=/story/${demoGroupClassification}-charts-${demo.id}`}>
<img src={STORYBOOK_LOGO} alt="" style={{ height: 20 }} />
</MiniCard>
)}
{numberOfRemainingDemos > 0 && (
<MiniCard
title={`${numberOfRemainingDemos} more demo${
numberOfRemainingDemos > 1 ? 's' : ''
}`}
href={`https://carbon-design-system.github.io/carbon-charts/?path=/story/${demoGroupClassification}-charts-${demo.id}`}>
<img src={STORYBOOK_LOGO} alt="" style={{ height: 20 }} />
</MiniCard>
)}
</div>
);
};
Expand Down
67 changes: 67 additions & 0 deletions src/pages/data-visualization/chart-types/images/networkdiagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

1 comment on commit 0175022

@vercel
Copy link

@vercel vercel bot commented on 0175022 Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.