-
Notifications
You must be signed in to change notification settings - Fork 121
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
docs: enable story source for current stories #557
Conversation
Move `Datum`, `Rotation`, `Position` and `Color` to `utils/commons`. Decouple legend from axis position method and move the `scales` to `utils/scales`.
Hey @rshen91 I've seen that we can maybe do a cleaner path instead of reenabling the info addon that bring in some issues: we can use the StorySource addon that adds a new tab near the Knobs with the code listed directly from the story.
For me it seems to render a more readable and usable code than the addon-info |
b13f6b4
to
9cee43c
Compare
Codecov Report
@@ Coverage Diff @@
## master #557 +/- ##
=========================================
Coverage ? 71.82%
=========================================
Files ? 212
Lines ? 6143
Branches ? 1181
=========================================
Hits ? 4412
Misses ? 1712
Partials ? 19 Continue to review full report at Codecov.
|
This commit will decouple the tooltip component from the XY chart to allow Partition and other chart type an ease use. BREAKING CHANGE: the `SeriesIdentifier` type is generalized into a simplified object with two values in common: `specId` and `key`. A specialized `XYChartSeriesIdentifier` extends now the base `SeriesIdentifier`. The `SettingsSpec` prop `showLegendDisplayValue` is renamed to `showLegendExtra` and its default value is now `false` hiding the current/last value on the legend by default. close elastic#246
The area-chart-band-area baseline was updated because seems that there is some differences between the rendered chart and the previous baseline due to the randomnumber generation
4d73ff3
to
03c227c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! Thanks for fixing the naming and making it much more intuitive
- I like how
Annotations
is broken into lines and rects. - Also, the info text is much cleaner now too.
- I also like the selectedPanels addition - I think it's an improvement for the user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested locally in Chrome and Firefox. Looked through dozens of stories and all seem to be fine. All screenshots are just renamed with no changes.
The separation of story files vastly improves the source load time.
Love the linting rule. Finally someone listened to me 😭
@@ -39,7 +39,7 @@ export const Basic = () => { | |||
<Chart className={className}> | |||
<BarSeries | |||
id={specId} | |||
name={'Simple bar series'} | |||
name="Simple bar series" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4,22 +4,22 @@ describe('Annotations stories', () => { | |||
describe('rotation', () => { | |||
it('rotation - 0', async () => { | |||
await common.expectChartAtUrlToMatchScreenshot( | |||
'http://localhost:9001/?path=/story/annotations--test-line-annotation-single-value-histogram&knob-debug=&knob-chartRotation=0', | |||
'http://localhost:9001/?path=/story/annotations-lines--single-bar-histogram&knob-debug=&knob-chartRotation=0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -5,7 +5,7 @@ | |||
You can import Chart components from the top-level Elastic Chart module. | |||
|
|||
```js | |||
import { Axis, BarSeries, Chart, getAxisId, getSpecId, Position, ScaleType } from '@elastic/charts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
wiki/overview.md
Outdated
@@ -48,18 +48,18 @@ A spec can be something like the following: | |||
```jsx | |||
<Chart renderer={renderer}> | |||
<Settings rotation={rotation} animateData={true} /> | |||
<Axis id={getAxisId('bottom')} position={AxisPosition.Bottom} title={`Rendering test`} /> | |||
<Axis id={getAxisId('left')} position={AxisPosition.Left} /> | |||
<Axis id={('bottom')} position={AxisPosition.Bottom} title={`Rendering test`} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??? no linting on mds 😞
Might as well clean this up when you update the branch
This commit add the storySource addon to visualize the source code of each stories on the right panel Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Summary
This PR enables the story source add-on for stories while consumer facing storybook is in progress.
Visual regression tests were rerun because of the url naming changes with changing the fs for /stories/.
The webpack config was edited to add story-source for each folder containing separate stories. Please feel free to propose a more succinct solution in the webpack config for the 14 or so folders (wildcard didn't work in testing).
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Any consumer-facing exports were added tosrc/index.ts
(and stories only import from../src
except for test data & storybook)- [ ] This was checked for cross-browser compatibility, including a check against IE11