carbon-charts icon indicating copy to clipboard operation
carbon-charts copied to clipboard

Updated public api, added exports for Legend/Roles enums and tools.

Open vrg84 opened this issue 3 months ago • 13 comments

Updates

Core

  • Exposed enums LegendEvent and Roles
  • Exposed helper functions from /packages/core/src/tools.ts.

vrg84 avatar Sep 16 '25 13:09 vrg84

Deploy Preview for carbon-charts-react ready!

Name Link
Latest commit adb4bb00ba105bb5885f7757bc4556f11b6476dc
Latest deploy log https://app.netlify.com/projects/carbon-charts-react/deploys/68c964b12ec6a80008516bcd
Deploy Preview https://deploy-preview-2032--carbon-charts-react.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 16 '25 13:09 netlify[bot]

Deploy Preview for carbon-charts-angular ready!

Name Link
Latest commit adb4bb00ba105bb5885f7757bc4556f11b6476dc
Latest deploy log https://app.netlify.com/projects/carbon-charts-angular/deploys/68c964b1bf00360008291b4a
Deploy Preview https://deploy-preview-2032--carbon-charts-angular.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 16 '25 13:09 netlify[bot]

Deploy Preview for carbon-charts-docs ready!

Name Link
Latest commit adb4bb00ba105bb5885f7757bc4556f11b6476dc
Latest deploy log https://app.netlify.com/projects/carbon-charts-docs/deploys/68c964b190448600084a0d38
Deploy Preview https://deploy-preview-2032--carbon-charts-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 16 '25 13:09 netlify[bot]

All contributors have signed the DCO.
Posted by the DCO Assistant Lite bot.

carbon-bot avatar Sep 16 '25 13:09 carbon-bot

Deploy Preview for carbon-charts-core ready!

Name Link
Latest commit adb4bb00ba105bb5885f7757bc4556f11b6476dc
Latest deploy log https://app.netlify.com/projects/carbon-charts-core/deploys/68c964b2bf00360008291b4c
Deploy Preview https://deploy-preview-2032--carbon-charts-core.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 16 '25 13:09 netlify[bot]

I have read the DCO document and I hereby sign the DCO.

vrg84 avatar Sep 16 '25 13:09 vrg84

Recheck

vrg84 avatar Sep 16 '25 13:09 vrg84

Hi @vrg84, I'm curious why we'd want these functions being exported? image

these are internal tools that might change at any point

theiliad avatar Sep 18 '25 18:09 theiliad

Hi @vrg84, I'm curious why we'd want these functions being exported?

these are internal tools that might change at any point

The library doesn’t provide a grouped + stacked bar chart. Since we need this feature, we extended Bar and followed the approach in bar-grouped.ts to a version that suits our needs.

The helpers (generateSVGPathString, getProperty, flipSVGCoordinatesBasedOnOrientation, mergeDefaultChartOptions, updateLegendAdditionalItems) have some non-trivial logic. I figured that reimplementing them outside the library risks inconsistencies if they change.

The goal of using the same helpers is keeping our custom chart behavior visually and functionally consistent with the library.

image

vrg84 avatar Sep 19 '25 12:09 vrg84

The library doesn’t provide a grouped + stacked bar chart. Since we need this feature, we extended Bar and followed the approach in bar-grouped.ts to a version that suits our needs.

@vrg84 why not contribute the grouped stacked bar chart instead?

theiliad avatar Sep 19 '25 15:09 theiliad

The library doesn’t provide a grouped + stacked bar chart. Since we need this feature, we extended Bar and followed the approach in bar-grouped.ts to a version that suits our needs.

@vrg84 why not contribute the grouped stacked bar chart instead?

I wish i could, i just dont have the time right now take it to where it needs to be. Its at a bare minimum to fit our needs.

Having said that, i do realize the exposed tools are only ever used in creating a new chart / extending the functionality... i'll see if i can make time to create a proper issue for it instead and start/share the work, maybe more people can contribute.

vrg84 avatar Sep 19 '25 18:09 vrg84

The library doesn’t provide a grouped + stacked bar chart. Since we need this feature, we extended Bar and followed the approach in bar-grouped.ts to a version that suits our needs.

@vrg84 why not contribute the grouped stacked bar chart instead?

I wish i could, i just dont have the time right now take it to where it needs to be. Its at a bare minimum to fit our needs.

Having said that, i do realize the exposed tools are only ever used in creating a new chart / extending the functionality... i'll see if i can make time to create a proper issue for it instead and start/share the work, maybe more people can contribute.

would you like to share your current code that achieves the grouped+stacked bar functionality? and maybe I could get it into the library, no promises though 🙂

theiliad avatar Sep 19 '25 18:09 theiliad

The library doesn’t provide a grouped + stacked bar chart. Since we need this feature, we extended Bar and followed the approach in bar-grouped.ts to a version that suits our needs.

@vrg84 why not contribute the grouped stacked bar chart instead?

I wish i could, i just dont have the time right now take it to where it needs to be. Its at a bare minimum to fit our needs. Having said that, i do realize the exposed tools are only ever used in creating a new chart / extending the functionality... i'll see if i can make time to create a proper issue for it instead and start/share the work, maybe more people can contribute.

would you like to share your current code that achieves the grouped+stacked bar functionality? and maybe I could get it into the library, no promises though 🙂

Yes! I have no expectations since it seems like theres still a lot of work to do, but I ported it into my fork: https://github.com/vrg84/carbon-charts/tree/grouped-stacked-bar-chart

I've taken some steps to make it run with a simple example (located in https://github.com/vrg84/carbon-charts/blob/grouped-stacked-bar-chart/packages/docs/src/lib/bar/examplesGroupedStacked.ts

image

But like i said, this implementation was tailored to our needs (it was the best i can do in a few days), this is still missing from the top of my head:

  • Extended tooltip, its not clear now which "stack" you are looking at. We've customized it with the customHTML tooltip but i guess there should be a default for it
  • Table view has not been implemented
  • CSV export has not been implemented
  • Only the vertical orientation works like it should
  • Only the labels scaleType has been tested

It was fun diving into the library and d3.js for a bit 😄thanks for your time!

vrg84 avatar Sep 19 '25 21:09 vrg84