-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add step labeling to sankey #73
Conversation
the repeated commits might be due to me rebasing after I had already pushed this branch up.. will be squashed and merged anyway so shouldn't affect anything |
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.
small notes but lgtm
_____|\
_.--| SSt |:
<____|.----||
.---''---,
;..__..' _...
,'/ ;|/..--'' \
,'_/.-/': :
_..-'''/ / | \ \ _|/|
\ /-./_ \; \ \,;' \
,\ / \: `:\ \ // `:`.
,' \ /-._; | : : :: ,. .
,' :: /`-._| | | || ' : `.`.)
_,' |;._:: | | | | `| : `'
,' `. / |`-:_ ; | | | : \
`--. ) /|-._: : | \ \
/ / :_| ;`-._; __..--'; : :
/ ( ;|;-./_ _/.-:'o | / ' |
/ , \._/_/_./--''/_|:|___|_,' |
: / `'-'--'----'---------' |
| : O ._O O_. O ._O O_. ; ;
: `. // // // // ,' /
~~~`.______//____//____//____//_______,'~
// //~ // //
~~ _// _// _// ~ _// ~
~ / / / / / / / / ~ ~~
~~~ ~~~ ~~~ ~~~
const depthMapXPos = {}; | ||
const depthMapYPos = {}; | ||
|
||
nodes.forEach(n => { |
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.
are nodes dom elements?
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.
these are the nodes returned to us after creating the Sankey graph using d3
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.
I just wanted to make sure that this isn't a DOM element array, as they don't have the same prototypical functions as regular arrays
src/SankeyDiagram.js
Outdated
nodes.forEach(n => { | ||
depthMapXPos[n.depth] = n.x0; | ||
|
||
if (depthMapYPos[n.depth]) { |
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 can be flattened into a ternary
src/SankeyDiagram.js
Outdated
depthMapYPos[n.depth] = n.y0; | ||
} | ||
// For the given depth, set the y equal to the highest positioned y value | ||
depthMapYPos[n.depth] |
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.
sorry to be picky, but I think it would be more readable to do
depthMapYPos[n.depth] = depthMapYPos[n.depth] ? Math.min(n.y0, depthMapYPos[n.depth] : n.y0;
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.
that's true 👍
* Histogram improvements + tests (#57) * Add react-docgen to devDependencies * Histogram improvements - calculate yDomain and based off given data. Include mouse interaction and styling props. Add tests. * Test horizontal props for BarChart * Histogram - move binning into render function to handle dynamic data, make value prop a function, improve docs, remove unused code * rebuild docs * Integrate prettier & eslint code styles + add linting as part of npm test (#58) * Add prettier & eslint code style rules * Include eslint process with npm test * Clean up and refactor (#59) * Add prettier & eslint code style rules * Remove legacy code and evaluate any todos * Only send valid XYPlot props to children. Resolves #22 * Check against master list of scaleTypes * Implement invertX and invertY scale * Alphabetically sort props displayed on docs * Update documentation for x and y axis labels and titles * Clean up code and todos * includeXZero and includeYZero props + test * feature(yaml): add ci/cd (#60) * feature(version): version bump (#61) * feature(version): version bump * feature(lockfile): add a lockfile * Clean up multiple warning logs and fix regression on children components not getting their defaultProps (#64) * Include css in root and add less -> css to build process (#63) * Include css in root and add to build process * Update readme directions to run examples * add AreaBarChart spec (#65) * Namespace css classes + update class and style props where applicable (#66) * AreaChartBar namespace * AreaChart namespace * AreaHeatMap namespace + accessor class and style funcs * BarChart update documentation * ColorHeatmap namespace and update documentation * FunnelChart namespace and accessors * Add lineStyle and lineClassName to KDE and remove unused prop in LineChart * MarketLineChart namespace and class and style accessors * RangeBarChart namespace * ScatterPlot namespace * PieChart documentation and updates * XYPlot namespace and underlying components * Add classes to linechart, remove unused styles * Namespace SankeyDiagram and updates to PieChart * Update tests * Update docs * Add backwards compatibility for markerLineClass * Update docs * Use className from props for RangeRect * Add disableMouseWheelZoom prop to ZoomContainer (#67) * Add disable mousewheel prop to reactochart * Update docs * 0.4.6 release (#68) * Update README.md to include directions for importing styles (#71) * add ColorHeatmap spec (#72) * add ColorHeatmap spec * generate build docs * Add step labeling to sankey (#73) * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * PR review + documentation * Better ternary * Update changelog and bump version (#74)
* Histogram improvements + tests (#57) * Add react-docgen to devDependencies * Histogram improvements - calculate yDomain and based off given data. Include mouse interaction and styling props. Add tests. * Test horizontal props for BarChart * Histogram - move binning into render function to handle dynamic data, make value prop a function, improve docs, remove unused code * rebuild docs * Integrate prettier & eslint code styles + add linting as part of npm test (#58) * Add prettier & eslint code style rules * Include eslint process with npm test * Clean up and refactor (#59) * Add prettier & eslint code style rules * Remove legacy code and evaluate any todos * Only send valid XYPlot props to children. Resolves #22 * Check against master list of scaleTypes * Implement invertX and invertY scale * Alphabetically sort props displayed on docs * Update documentation for x and y axis labels and titles * Clean up code and todos * includeXZero and includeYZero props + test * feature(yaml): add ci/cd (#60) * feature(version): version bump (#61) * feature(version): version bump * feature(lockfile): add a lockfile * Clean up multiple warning logs and fix regression on children components not getting their defaultProps (#64) * Include css in root and add less -> css to build process (#63) * Include css in root and add to build process * Update readme directions to run examples * add AreaBarChart spec (#65) * Namespace css classes + update class and style props where applicable (#66) * AreaChartBar namespace * AreaChart namespace * AreaHeatMap namespace + accessor class and style funcs * BarChart update documentation * ColorHeatmap namespace and update documentation * FunnelChart namespace and accessors * Add lineStyle and lineClassName to KDE and remove unused prop in LineChart * MarketLineChart namespace and class and style accessors * RangeBarChart namespace * ScatterPlot namespace * PieChart documentation and updates * XYPlot namespace and underlying components * Add classes to linechart, remove unused styles * Namespace SankeyDiagram and updates to PieChart * Update tests * Update docs * Add backwards compatibility for markerLineClass * Update docs * Use className from props for RangeRect * Add disableMouseWheelZoom prop to ZoomContainer (#67) * Add disable mousewheel prop to reactochart * Update docs * 0.4.6 release (#68) * Update README.md to include directions for importing styles (#71) * add ColorHeatmap spec (#72) * add ColorHeatmap spec * generate build docs * Add step labeling to sankey (#73) * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * PR review + documentation * Better ternary * Update changelog and bump version (#74) * add AreaHeatmap, FunnelChart spec (#77) * add AreaHeatmap spec * add FunnelChart spec * feature(Standards): add in code of conduct and NOTICE file (#76) * Zoom container spec (#78) * Zoom Container spec * Added npm run test-files * Add eslint to tests (#79) * Add tests to linter * Update tests with lint-fix * Fix growl dependency via mocha (#80) * Fix growl dependency on mocha * Update package lock json * Update version and changelog (#81)
* Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * PR review + documentation * Better ternary
* Histogram improvements + tests (#57) * Add react-docgen to devDependencies * Histogram improvements - calculate yDomain and based off given data. Include mouse interaction and styling props. Add tests. * Test horizontal props for BarChart * Histogram - move binning into render function to handle dynamic data, make value prop a function, improve docs, remove unused code * rebuild docs * Integrate prettier & eslint code styles + add linting as part of npm test (#58) * Add prettier & eslint code style rules * Include eslint process with npm test * Clean up and refactor (#59) * Add prettier & eslint code style rules * Remove legacy code and evaluate any todos * Only send valid XYPlot props to children. Resolves #22 * Check against master list of scaleTypes * Implement invertX and invertY scale * Alphabetically sort props displayed on docs * Update documentation for x and y axis labels and titles * Clean up code and todos * includeXZero and includeYZero props + test * feature(yaml): add ci/cd (#60) * feature(version): version bump (#61) * feature(version): version bump * feature(lockfile): add a lockfile * Clean up multiple warning logs and fix regression on children components not getting their defaultProps (#64) * Include css in root and add less -> css to build process (#63) * Include css in root and add to build process * Update readme directions to run examples * add AreaBarChart spec (#65) * Namespace css classes + update class and style props where applicable (#66) * AreaChartBar namespace * AreaChart namespace * AreaHeatMap namespace + accessor class and style funcs * BarChart update documentation * ColorHeatmap namespace and update documentation * FunnelChart namespace and accessors * Add lineStyle and lineClassName to KDE and remove unused prop in LineChart * MarketLineChart namespace and class and style accessors * RangeBarChart namespace * ScatterPlot namespace * PieChart documentation and updates * XYPlot namespace and underlying components * Add classes to linechart, remove unused styles * Namespace SankeyDiagram and updates to PieChart * Update tests * Update docs * Add backwards compatibility for markerLineClass * Update docs * Use className from props for RangeRect * Add disableMouseWheelZoom prop to ZoomContainer (#67) * Add disable mousewheel prop to reactochart * Update docs * 0.4.6 release (#68) * Update README.md to include directions for importing styles (#71) * add ColorHeatmap spec (#72) * add ColorHeatmap spec * generate build docs * Add step labeling to sankey (#73) * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * PR review + documentation * Better ternary * Update changelog and bump version (#74)
* Histogram improvements + tests (#57) * Add react-docgen to devDependencies * Histogram improvements - calculate yDomain and based off given data. Include mouse interaction and styling props. Add tests. * Test horizontal props for BarChart * Histogram - move binning into render function to handle dynamic data, make value prop a function, improve docs, remove unused code * rebuild docs * Integrate prettier & eslint code styles + add linting as part of npm test (#58) * Add prettier & eslint code style rules * Include eslint process with npm test * Clean up and refactor (#59) * Add prettier & eslint code style rules * Remove legacy code and evaluate any todos * Only send valid XYPlot props to children. Resolves #22 * Check against master list of scaleTypes * Implement invertX and invertY scale * Alphabetically sort props displayed on docs * Update documentation for x and y axis labels and titles * Clean up code and todos * includeXZero and includeYZero props + test * feature(yaml): add ci/cd (#60) * feature(version): version bump (#61) * feature(version): version bump * feature(lockfile): add a lockfile * Clean up multiple warning logs and fix regression on children components not getting their defaultProps (#64) * Include css in root and add less -> css to build process (#63) * Include css in root and add to build process * Update readme directions to run examples * add AreaBarChart spec (#65) * Namespace css classes + update class and style props where applicable (#66) * AreaChartBar namespace * AreaChart namespace * AreaHeatMap namespace + accessor class and style funcs * BarChart update documentation * ColorHeatmap namespace and update documentation * FunnelChart namespace and accessors * Add lineStyle and lineClassName to KDE and remove unused prop in LineChart * MarketLineChart namespace and class and style accessors * RangeBarChart namespace * ScatterPlot namespace * PieChart documentation and updates * XYPlot namespace and underlying components * Add classes to linechart, remove unused styles * Namespace SankeyDiagram and updates to PieChart * Update tests * Update docs * Add backwards compatibility for markerLineClass * Update docs * Use className from props for RangeRect * Add disableMouseWheelZoom prop to ZoomContainer (#67) * Add disable mousewheel prop to reactochart * Update docs * 0.4.6 release (#68) * Update README.md to include directions for importing styles (#71) * add ColorHeatmap spec (#72) * add ColorHeatmap spec * generate build docs * Add step labeling to sankey (#73) * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * Add step labeling functionality to sankey * Update tests for sankey to include step labels * Update docs * PR review + documentation * Better ternary * Update changelog and bump version (#74) * add AreaHeatmap, FunnelChart spec (#77) * add AreaHeatmap spec * add FunnelChart spec * feature(Standards): add in code of conduct and NOTICE file (#76) * Zoom container spec (#78) * Zoom Container spec * Added npm run test-files * Add eslint to tests (#79) * Add tests to linter * Update tests with lint-fix * Fix growl dependency via mocha (#80) * Fix growl dependency on mocha * Update package lock json * Update version and changelog (#81)
Adds step labeling to Sankey. Users must opt in to have labels show up