Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codesandbox examples for charting demos #987

Merged
merged 37 commits into from
Jun 23, 2020
Merged

Codesandbox examples for charting demos #987

merged 37 commits into from
Jun 23, 2020

Conversation

theiliad
Copy link
Member

@theiliad theiliad commented Mar 5, 2020

  • Automatic demo generation using the Carbon Charts storybook examples
  • Addition of CodeSandbox links to every demo
  • Cleaning up the dataviz demo pages

Closes #1271

@vercel
Copy link

vercel bot commented Mar 5, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carbon-design-system/carbon-website/mf8fm2kew
✅ Preview: https://carbon-website-git-fork-theiliad-codesandbox-dataviz.carbon-design-system.vercel.app

@vercel vercel bot temporarily deployed to Preview March 5, 2020 21:02 Inactive
@netlify
Copy link

netlify bot commented Apr 9, 2020

Deploy preview for carbon-website failed.

Built with commit c4c8869

https://app.netlify.com/sites/carbon-website/deploys/5e8f8efc021d44000718d0bc

@theiliad theiliad marked this pull request as ready for review April 9, 2020 20:55
@theiliad theiliad requested review from a team April 9, 2020 20:55
@theiliad theiliad requested a review from a team as a code owner April 9, 2020 20:55
@theiliad theiliad requested review from janchild, vpicone and sstrubberg and removed request for a team April 9, 2020 20:55
@ghost ghost requested review from aledavila and emyarod and removed request for a team April 9, 2020 20:55
@theiliad
Copy link
Member Author

All looking good but I have one question regarding certain vertical grid lines aligning to the week dates in time series. The lines do not align to the days/dates that are visible? This seems like a mistake. @shixiedesign @jeanservaas @cameroncalder

Screen Shot 2020-06-22 at 12 04 16 PM

——————

Screen Shot 2020-06-22 at 12 04 41 PM

——————

Screen Shot 2020-06-22 at 12 04 59 PM

——————

Screen Shot 2020-06-22 at 12 05 14 PM

again, separate issue irrelevant to this PR.

@theiliad
Copy link
Member Author

the build has not started after 45 minutes which is why github is showing the red X beside vercel, @vpicone could you restart it please?

@mjabbink
Copy link
Contributor

mjabbink commented Jun 22, 2020

aren’t those the sandbox examples? If this is about just the layout of the page then this looks good to go other than Resource card needs to be under the anchor links

————

Screen Shot 2020-06-22 at 12 58 03 PM

————

The anchor links go under the introduction paragraph then resource card like below

Screen Shot 2020-06-22 at 12 59 41 PM

@theiliad
Copy link
Member Author

aren’t those the sandbox examples? If this is about just the layout of the page then this looks good to go.

this PR's job is to add our existing sandbox examples to the carbon website. what you're mentioning would be a bug (if broken) in the actual Carbon Charts library. Also, labels were refactored by accurat, so this is either something that they missed or didn't start with as a requirement

@theiliad
Copy link
Member Author

Resource card needs to be under the anchor links

done @mjabbink

@designertyler designertyler self-requested a review June 22, 2020 18:29
@mjabbink
Copy link
Contributor

Don’t see it reflected in the preview but assume it follows all the other pages with resource card placed under the intro and anchor links. Good to merge otherwise.

@theiliad
Copy link
Member Author

Don’t see it reflected in the preview but assume it follows all the other pages with resource card placed under the intro and anchor links. Good to merge otherwise.

yes, the preview is still building, probably another 10-15minutes but yes I've moved the resources card below anchor links

@mjabbink
Copy link
Contributor

@theiliad See it now and good to go.

@theiliad
Copy link
Member Author

@theiliad See it now and good to go.

great thanks Mike

Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

Couple of minor things!

<a target="_blank" rel="noopener noreferrer" href={sandboxUrl}>
CodeSandbox <Launch16 />
</a>
{showSandboxURL && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the re-use of the code bar. I'm confused how showSandboxURL is meant to be used though. As is, this check would mean we have to add showSandboxURL=true to all of our deployed ComponentDemos (they're currently missing the sandbox link in build preview).

What if instead, useCodesandbox returned null when no code is provided. We could use sandboxUrl && to determine whether to show the link or not.

Suggested change
{showSandboxURL && (
{sandboxUrl && (

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch

) : (
)}

{!src && code && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{!src && code && (
{shouldShowCopyButton (

Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

Some really minor things, great work re-purposing this component!

@@ -17,21 +17,24 @@ const StorybookLink = ({ framework, url }) => (
</a>
);

const CodeBar = ({ src, code, links }) => {
const CodeBar = ({ src, code, links, showSandboxURL }) => {
const sandboxUrl = useCodesandbox(code);
const storybookLinks = Object.entries(links);

Copy link
Contributor

@vpicone vpicone Jun 22, 2020

Choose a reason for hiding this comment

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

subjective alert Do you mind moving this into a single, affirmative boolean. Just to clarify the intent a bit we can avoid chaining shortcuts. Not sure how you would have known this, it should be codified in an eslint rule.

@theiliad
Copy link
Member Author

Some really minor things, great work re-purposing this component!

all addressed, I'd probably squash & merge since there are tons of commits

Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for the quick corrections 🚀

@mjabbink
Copy link
Contributor

👍

@vpicone vpicone merged commit 5cb04e0 into carbon-design-system:master Jun 23, 2020
@theiliad theiliad deleted the codesandbox-dataviz branch June 23, 2020 13:55
natashadecoste pushed a commit to natashadecoste/carbon-website that referenced this pull request May 19, 2021
* initial effort

* add dynamic demos to basic charts

* update charting package version, optimize demo components

* fix lint error

* update @carbon/charts to 0.32.3

* add image alt tags to dataviz chart types page

* update yarn.lock

* fix styling issues

* styling fixes

* undo overview-card tag height change

* move resources below anchor links for basic charts page

* final touch on CodeBar

Co-authored-by: TJ Egan <[email protected]>
natashadecoste pushed a commit to natashadecoste/carbon-website that referenced this pull request May 19, 2021
* initial effort

* add dynamic demos to basic charts

* update charting package version, optimize demo components

* fix lint error

* update @carbon/charts to 0.32.3

* add image alt tags to dataviz chart types page

* update yarn.lock

* fix styling issues

* styling fixes

* undo overview-card tag height change

* move resources below anchor links for basic charts page

* final touch on CodeBar

Co-authored-by: TJ Egan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Viz Radar svg needs a transparent background
6 participants