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

fix(xychart): support fragment and array type children of stacks/groups #1259

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Jun 30, 2021

🐛 Bug Fix

Fixes #1040

Demo with the following (also validated with BarGroup and BarStack)

<AreaStack curve={curve} offset={stackOffset} renderLine={stackOffset !== 'wiggle'}>
  <>
    <AreaSeries
      dataKey="Austin"
      data={data}
      xAccessor={accessors.x.Austin}
      yAccessor={accessors.y.Austin}
      fillOpacity={0.4}
    />
    <AreaSeries
      dataKey="New York"
      data={data}
      xAccessor={accessors.x['New York']}
      yAccessor={accessors.y['New York']}
      fillOpacity={0.4}
    />
    <AreaSeries
      dataKey="San Francisco"
      data={data}
      xAccessor={accessors.x['San Francisco']}
      yAccessor={accessors.y['San Francisco']}
      fillOpacity={0.4}
    />
  </>
</AreaStack>

@kristw
cc @valtism @tonyneel923

@williaster
Copy link
Collaborator Author

noting this syntax also works
image

@github-actions
Copy link

Size Changes

Package Diff ESM Prev ESM CJS Prev CJS
visx-xychart +0.3% 165.47 KB 165 KB 230.58 KB 229.98 KB

Compared to master. File sizes are unminified and ungzipped.

View raw build stats

Previous (master)

{
  "visx-annotation": {
    "esm": 28965,
    "lib": 39026
  },
  "visx-axis": {
    "esm": 20727,
    "lib": 25127
  },
  "visx-bounds": {
    "esm": 2842,
    "lib": 3264
  },
  "visx-brush": {
    "esm": 44108,
    "lib": 47853
  },
  "visx-chord": {
    "esm": 3459,
    "lib": 4688
  },
  "visx-clip-path": {
    "esm": 4421,
    "lib": 5978
  },
  "visx-curve": {
    "esm": 323,
    "lib": 1464
  },
  "visx-demo": {
    "esm": 0,
    "lib": 0
  },
  "visx-drag": {
    "esm": 6267,
    "lib": 8304
  },
  "visx-event": {
    "esm": 3797,
    "lib": 5172
  },
  "visx-geo": {
    "esm": 13259,
    "lib": 16519
  },
  "visx-glyph": {
    "esm": 14893,
    "lib": 19789
  },
  "visx-gradient": {
    "esm": 17800,
    "lib": 22517
  },
  "visx-grid": {
    "esm": 18922,
    "lib": 22784
  },
  "visx-group": {
    "esm": 1619,
    "lib": 2246
  },
  "visx-heatmap": {
    "esm": 7286,
    "lib": 8622
  },
  "visx-hierarchy": {
    "esm": 12266,
    "lib": 18076
  },
  "visx-legend": {
    "esm": 26999,
    "lib": 34033
  },
  "visx-marker": {
    "esm": 8962,
    "lib": 11197
  },
  "visx-mock-data": {
    "esm": 326005,
    "lib": 329416
  },
  "visx-network": {
    "esm": 4546,
    "lib": 6706
  },
  "visx-pattern": {
    "esm": 11779,
    "lib": 15910
  },
  "visx-point": {
    "esm": 819,
    "lib": 1094
  },
  "visx-react-spring": {
    "esm": 14096,
    "lib": 18637
  },
  "visx-responsive": {
    "esm": 21901,
    "lib": 26961
  },
  "visx-scale": {
    "esm": 18452,
    "lib": 29710
  },
  "visx-shape": {
    "esm": 83534,
    "lib": 104480
  },
  "visx-stats": {
    "esm": 13911,
    "lib": 15494
  },
  "visx-text": {
    "esm": 8518,
    "lib": 10981
  },
  "visx-threshold": {
    "esm": 2911,
    "lib": 3820
  },
  "visx-tooltip": {
    "esm": 14147,
    "lib": 20413
  },
  "visx-visx": {
    "esm": 970,
    "lib": 8243
  },
  "visx-voronoi": {
    "esm": 2286,
    "lib": 3005
  },
  "visx-xychart": {
    "esm": 168957,
    "lib": 235497
  },
  "visx-zoom": {
    "esm": 16029,
    "lib": 17701
  }
}

Current

{
  "visx-annotation": {
    "esm": 28965,
    "lib": 39026
  },
  "visx-axis": {
    "esm": 20727,
    "lib": 25127
  },
  "visx-bounds": {
    "esm": 2842,
    "lib": 3264
  },
  "visx-brush": {
    "esm": 44108,
    "lib": 47853
  },
  "visx-chord": {
    "esm": 3459,
    "lib": 4688
  },
  "visx-clip-path": {
    "esm": 4421,
    "lib": 5978
  },
  "visx-curve": {
    "esm": 323,
    "lib": 1464
  },
  "visx-demo": {
    "esm": 0,
    "lib": 0
  },
  "visx-drag": {
    "esm": 6267,
    "lib": 8304
  },
  "visx-event": {
    "esm": 3797,
    "lib": 5172
  },
  "visx-geo": {
    "esm": 13259,
    "lib": 16519
  },
  "visx-glyph": {
    "esm": 14893,
    "lib": 19789
  },
  "visx-gradient": {
    "esm": 17800,
    "lib": 22517
  },
  "visx-grid": {
    "esm": 18922,
    "lib": 22784
  },
  "visx-group": {
    "esm": 1619,
    "lib": 2246
  },
  "visx-heatmap": {
    "esm": 7286,
    "lib": 8622
  },
  "visx-hierarchy": {
    "esm": 12266,
    "lib": 18076
  },
  "visx-legend": {
    "esm": 26999,
    "lib": 34033
  },
  "visx-marker": {
    "esm": 8962,
    "lib": 11197
  },
  "visx-mock-data": {
    "esm": 326005,
    "lib": 329416
  },
  "visx-network": {
    "esm": 4546,
    "lib": 6706
  },
  "visx-pattern": {
    "esm": 11779,
    "lib": 15910
  },
  "visx-point": {
    "esm": 819,
    "lib": 1094
  },
  "visx-react-spring": {
    "esm": 14096,
    "lib": 18637
  },
  "visx-responsive": {
    "esm": 21901,
    "lib": 26961
  },
  "visx-scale": {
    "esm": 18452,
    "lib": 29710
  },
  "visx-shape": {
    "esm": 83534,
    "lib": 104480
  },
  "visx-stats": {
    "esm": 13911,
    "lib": 15494
  },
  "visx-text": {
    "esm": 8518,
    "lib": 10981
  },
  "visx-threshold": {
    "esm": 2911,
    "lib": 3820
  },
  "visx-tooltip": {
    "esm": 14147,
    "lib": 20413
  },
  "visx-visx": {
    "esm": 970,
    "lib": 8243
  },
  "visx-voronoi": {
    "esm": 2286,
    "lib": 3005
  },
  "visx-xychart": {
    "esm": 169440,
    "lib": 236116
  },
  "visx-zoom": {
    "esm": 16029,
    "lib": 17701
  }
}

@williaster williaster requested a review from kristw July 1, 2021 19:24
@williaster
Copy link
Collaborator Author

ping @kristw whenever you have a sec/should be straight forward

Copy link
Collaborator

@kristw kristw left a comment

Choose a reason for hiding this comment

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

Lgtm

@williaster williaster merged commit c225cfb into master Jul 7, 2021
@williaster williaster deleted the chris--xychart-nested-children branch July 7, 2021 00:43
@github-actions
Copy link

github-actions bot commented Jul 7, 2021

🎉 This PR is included in version v1.16.1 of the packages modified 🎉

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.

[XYChart] <BarGroup> breaks when children are <React.Fragment>s
2 participants