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

Any example of function typed Data.order? #1863

Closed
bb-in-hoodie opened this issue Jan 11, 2021 · 3 comments
Closed

Any example of function typed Data.order? #1863

bb-in-hoodie opened this issue Jan 11, 2021 · 3 comments

Comments

@bb-in-hoodie
Copy link

bb-in-hoodie commented Jan 11, 2021

Description

I want to use function typed Data.order option but I cannot find a proper way to do it.

image
description
image
type definition
  1. it seems like type definition and API description doesn't match (I'm pretty sure that the type of each data must not be a simple string)
  2. there is no example to follow
  3. I tried to figure out what data parameter would represent by using some console.logs, but it seems like the function is never called once. (there was no log printed on Console with the code below)
    data: {
        order: function(...data) {
          console.log(data);
        },
    ...

Can you make an example of a function that can be used in Data.order function?

@netil netil added the question label Jan 11, 2021
@netil
Copy link
Member

netil commented Jan 12, 2021

Hi @BlackBindy, when data.order option function value is set, is working for non-arc types only for now.
If you're using gauge, donut or pie only "asc", "desc" & null are accepted.

I'll be considering the implementation for the next release.

@netil netil added the bug label Jan 12, 2021
@bb-in-hoodie
Copy link
Author

bb-in-hoodie commented Jan 13, 2021

Hi @BlackBindy, when data.order option function value is set, is working for non-arc types only for now.
If you're using gauge, donut or pie only "asc", "desc" & null are accepted.

I'll be considering the implementation for the next release.

thanks for your reply 👍🏼

then, if I want to set order: null to keep the original order of the input used in a donut chart, will putting a prefix such as _ on each key (if keys are number value) be the only solution? would there be no workaround?

// original data
{
  100: 10,
  101: 20,
  ...
}

// to
{
  _100: 10,
  _101: 20,
  ...
}

of course it might work, but if I attach a prefix once, I have to detach it everytime I need to use those keys (which never looks elegant enough).

netil added a commit to netil/billboard.js that referenced this issue Jan 13, 2021
- When data.order is given a function for arc type, make to invoke.
- Add examples code usiing data.order function

Fix naver#1863
@netil netil closed this as completed in 3a716a0 Jan 13, 2021
@netil
Copy link
Member

netil commented Jan 13, 2021

@BlackBindy, fixed the issue. I'll be releasing next tagged version soon.
So, if you're not hurry recommend use the fixed version.

netil added a commit to netil/billboard.js that referenced this issue Jan 13, 2021
Remove inconsistency between arc & other sort data param type.

Ref naver#1863
netil added a commit that referenced this issue Jan 13, 2021
Remove inconsistency between arc & other sort data param type.

Ref #1863
github-actions bot pushed a commit that referenced this issue Jan 13, 2021
# [2.2.0-next.6](2.2.0-next.5...2.2.0-next.6) (2021-01-13)

### Bug Fixes

* **data:** fix data.order to work for arc types ([3a716a0](3a716a0)), closes [#1863](#1863)
* **eventrect:** fix resizing event rect element after .load() ([12bf547](12bf547)), closes [#1864](#1864)
* **radar:** fix data label text position ([c69d674](c69d674)), closes [#1871](#1871)
* **tooltip:** fix arc's tooltip interaction ([a8586a3](a8586a3)), closes [#1859](#1859)
github-actions bot pushed a commit that referenced this issue Jan 26, 2021
# [2.2.0](2.1.4...2.2.0) (2021-01-26)

### Bug Fixes

* **api:** fix incorrect legend text positioning ([f1ede3f](f1ede3f)), closes [#1888](#1888)
* **api:** fix zoom for timesries axis ([0421a50](0421a50)), closes [#1868](#1868)
* **arc:** fix setting color value ([fad9e86](fad9e86)), closes [#1857](#1857) [#1847](#1847)
* **axis:** fix incorrect tick interval calculation ([1a96f3e](1a96f3e)), closes [#1896](#1896)
* **axis:** rotated horizontal xAxisHeight is calculated correctly after loading new data ([ef2754f](ef2754f)), closes [#1786](#1786) [#1787](#1787)
* **bar:** fix bar width on zoom ([25e987a](25e987a)), closes [#1907](#1907)
* **bar:** fix bar width rendering for 'total' data key ([eacaecb](eacaecb)), closes [#1818](#1818)
* **browser:** fix referencing global order ([8f84cb3](8f84cb3)), closes [#1778](#1778)
* **browser:** fix retrieving global ([3474ac0](3474ac0)), closes [#1826](#1826)
* **color:** fix color callback mismatch ([86ef214](86ef214)), closes [#1847](#1847)
* **data:** fix data.order to work for arc types ([3a716a0](3a716a0)), closes [#1863](#1863)
* **eventrect:** fix resizing event rect element after .load() ([12bf547](12bf547)), closes [#1864](#1864)
* **eventRect:** fix data.onclick work for scatter/bubble ([109c87d](109c87d)), closes [#1795](#1795)
* **point:** fix usePoint defs id value ([6df4653](6df4653)), closes [#1887](#1887)
* **radar:** fix data label text position ([c69d674](c69d674)), closes [#1871](#1871)
* **text:** data labels are working in Internet Explorer again ([865224e](865224e)), closes [#1877](#1877)
* **tooltip:** fix arc's tooltip interaction ([a8586a3](a8586a3)), closes [#1859](#1859)
* **types:** fix .load() data type ([7108e7b](7108e7b)), closes [#1848](#1848)

### Features

* **api:** make return values for axis.labels() ([efa5174](efa5174)), closes [#1865](#1865)
* **data:** Intent to ship data.label multiline ([8903aa6](8903aa6)), closes [#1784](#1784)
* **data.labels.colors:** Add callback support ([ac1affa](ac1affa)), closes [#1845](#1845)
* **gauge:** added support for drawing gauge from 'startingAngle' to 'arcLength' ([25954ad](25954ad)), closes [#1633](#1633) [#1803](#1803) [#1849](#1849)
* **gauge:** Intent to ship gauge.background ([632c600](632c600)), closes [#1804](#1804)
* **pie:** Intent to ship pie.outerRadius ([ca67418](ca67418)), closes [#1825](#1825)
* **point:** Intent to ship point.opacity ([fc5ad35](fc5ad35)), closes [#1867](#1867)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants