potion icon indicating copy to clipboard operation
potion copied to clipboard

Building out @potion/extra Axes, and React Hooks

Open b-n opened this issue 5 years ago • 1 comments

I've been playing with potionjs for a bunch of my recent hobby projects, and firstly I'd like to say thank you!

I was thinking of making a new npm package for composing some of the potionjs elements into opinionated charts (i.e. LineChart, BarChart, PieChart, etc), and I thought I'd start with Axes since these are generally needed. I then noticed @potion/extra has the Axis components, and they are currently commented out. So my questions are:

  • Are you planning on implementing the Axis components as you have them? (I see they have references to mixins which don't exist)
  • If not, do you want someone else to take a stab at it?
  • And if you wanted someone to take a stab at it, would you prefer React classes instead of hooks?

Excuse the gridlines, but this is what I was working on thus far: https://github.com/nzchicken/have-a-cookie/blob/new-web/web/src/components/Chart/Axes.js

The chart prop comes from a parent wrapping chart component, and is only needed for the gridlines and thus could be removed etc.

b-n avatar Mar 20 '19 19:03 b-n

Sorry for the delay on this - was occupied with personal stuff for a while. Great that you got something good out of potion!

Yes the plan was to implement axes - and yes I would welcome any PRs if you are still up for that.

Otherwise this lib is a good static alternative to potion which can be used together with it by only including the relevant modules. They both just output svg though so they are interoperable last I checked.

finnfiddle avatar Apr 06 '20 19:04 finnfiddle

Just tidying up old issues I created a long time ago and am not following up on. Cheers though!

b-n avatar Sep 06 '23 09:09 b-n