lukbukkit / chartist-plugin-tooltip

Tooltip plugin for Chartist.js
MIT License
16 stars 13 forks source link

migrate plugin to Typescript and generate modular packages #24

Open stklcode opened 1 year ago

stklcode commented 1 year ago

This is quite a major update. The Plugin and the project structure are updated to get closer to the Chartist v1 ecosystem.

I was wondering if the changes should be part of a new, shared repo, but I couldn't manage to start a discussion upstream. My goal is not to create and maintain yet another fork, so maybe we want to move this project in the proposed direction...

Changes:

Build Process:

New usage example:

import { LineChart } from 'chartist';
import { ChartistPluginTooltip } from 'chartist-plugin-tooltips';

new LineChart(
  '.ct-chart',
  {
    labels: [1, 2, 3, 4, 5, 6, 7],
    series: [
      [1, 5, 3, 4, 6, 2, 3],
      [2, 4, 2, 5, 4, 3, 6]
    ]
  },
  {
    plugins: [
      ChartistPluginTooltip
    ]
  }
);

or as UMD:

<html>
  <head>
  <script src="node_modules/chartist/dist/index.umd.js"></script>
  <script src="node_modules/chartist-plugin-tooltips-updated/dist/chartist-plugin-tooltip.umd.min.js"></script>

  <script>
    new Chartist.LineChart(
      '#chart',
      {
        labels: [1, 2, 3, 4, 5, 6, 7],
        series: [
          [1, 5, 3, 4, 6, 2, 3],
          [2, 4, 2, 5, 4, 3, 6]
        ]
      },
      {
        plugins: [ ChartistPluginTooltip ]
      }
    );
</script>
  </head>
  <body>
  <div id="chart"></div>
  </body>
</html>
stklcode commented 1 year ago

I tried to start a discussion about moving common plugins to the @chartist-js org: https://github.com/chartist-js/chartist/discussions/1391

lukbukkit commented 1 year ago

Sorry, for the long radio silence. The last months were very busy for me. I'll review your contributions in the following days or weeks. Did your code works well in production or do you've noticed any possible drawbacks?

stklcode commented 1 year ago

Just rebased the PR on top of the latest changes, so it can be applied cleanly again.

I'm using the updated lib in one project with various line charts and it served my need since I introduced the changes. (it's in an admin UI, so I currently don't have a public site to link here). I have not tested every single feature.

Don't know if there is any more complete example page that could be simply migrated to see if everything works as expected. We could probably build one.

lukbukkit commented 5 months ago

I'm sorry that I haven't found the time so far to review the pull request. My time available for open-source projects has decreased significantly in the last year. Are you using the plugin in production, and if so, would you be interested in maintaining it in the future?