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

add categorical data #340

Open
wadjih-bencheikh18 opened this issue Feb 17, 2022 · 5 comments
Open

add categorical data #340

wadjih-bencheikh18 opened this issue Feb 17, 2022 · 5 comments

Comments

@wadjih-bencheikh18
Copy link
Member

it will be great if on of axis data can be string

@lpatiny
Copy link
Contributor

lpatiny commented Feb 18, 2022

We need to add images of examples about what we would like to achieve as final plots.

One thing could be to have numerical values on the X axis and a callback that converts this numerical value to a string

There may be some other problem as well like where to place the label. In this case it is between the major tics.

image

@wadjih-bencheikh18
Copy link
Member Author

@wadjih-bencheikh18
Copy link
Member Author

@targos can i start working on this , in order to create violin plot #365

@wadjih-bencheikh18 wadjih-bencheikh18 changed the title add new data type add categorical data Mar 9, 2022
@targos
Copy link
Member

targos commented Mar 10, 2022

we're not sure we want to support categorical data in this project. this would add a lot of complexity

@lpatiny
Copy link
Contributor

lpatiny commented Mar 13, 2022

I would like to evaluate all the problems that would appear creating CategorySeries (HistogramSeries ?) and if does make sense to add this in the project (meaning not make hacks everywhere).

We should expect for this kind of series a lot of data and it could be the base to add box plots (another kind of CategorySeries).

<Plot width={300} height={300}>
  <Heading title="Fruit producers" />
  <CategorySeries
    data={{ banana: 4, apple: 5, kiwi: 0 }}
    label="Colombia"
  />
  <CategorySeries data={{ banana: 0, apple: 3, orange: 2 }} label="Spain" />
  <CategorySeries
    data={{ apple: 8}}
    label="Switzerland"
  />
</Plot>

We would need a CategoryAxis. The default value would go through all the CategorySeries and append the keys if it does not yet exists to the categories array. Of course no min / max for this kind of series.

paddingStart and paddingEnd would only be allowed in the svg units (pixels) or in %.

When many bar series are present on the same axis the axis could have a property stack: boolean to define if we should stack the bars or show them side by side.

What about annotations ?

Currently we have 3 kinds of units to place annotations:

  • 'svg unit (pixels)' this would not be a problem
  • '%' this should be ok as well
  • number corresponding to value on the axis (x / y). While y is a number so no problem, x is a category so it should be a string (not allow this case ?).

Superimposition of Series

We could have 2 axis, one with CategoryAxis and the other one 'normal'.

@targos @stropitek we could discuss this during next Thursday meeting to define if we close those issues or continue to explore. I was just working on histograms to display pellet hardness this week-end ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants