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

toggleShape not defined on onclick for scatter chart. #1795

Closed
lgardner-condati opened this issue Nov 25, 2020 · 2 comments
Closed

toggleShape not defined on onclick for scatter chart. #1795

lgardner-condati opened this issue Nov 25, 2020 · 2 comments
Labels

Comments

@lgardner-condati
Copy link

lgardner-condati commented Nov 25, 2020

Description

Attempting to implement onclick functions for billboard charts. I have it working for everything except bubble and scatter charts. Below examples are of scatter charts.

Originally believed #1752 might be my problem as our platform also resizes. However, upgrading to 2.1.4 did not fix the problem.

I tracked the error back to line 516 of src/ChartInternal/interactions/eventrect.ts
"TypeError: e.toggleShape is not a function" is the error output.

Steps to check or reproduce

I was unable to reproduce in the playground on observable. Please let me know anyway I might provide better reproduction steps.

var bbchart = bb.generate({
  "point": {
    "r": 10
  },
  "chartType": "billboard",
  "axis": {
    "x": {
      "label": "Session",
      "tick": {
        "fit": false
      }
    },
    "y": {
      "label": "Transactions",
      "tick": {}
    }
  },
  "tooltip": {},
  "data": {
    "names": {
      "TRANSACTIONS": "Transactions",
      "SESSIONS": "Session"
    },
    "json": [
      {
        "TRANSACTIONS": 0,
        "SESSIONS": 0
      },
      {
        "TRANSACTIONS": 3354,
        "SESSIONS": 26011
      },
      {
        "TRANSACTIONS": 499,
        "SESSIONS": 49810
      },
      {
        "TRANSACTIONS": 3206,
        "SESSIONS": 221198
      },
      {
        "TRANSACTIONS": 22822,
        "SESSIONS": 259192
      },
      {
        "TRANSACTIONS": 21657,
        "SESSIONS": 326251
      },
      {
        "TRANSACTIONS": 36920,
        "SESSIONS": 1030432
      },
      {
        "TRANSACTIONS": 53345,
        "SESSIONS": 1276156
      },
      {
        "TRANSACTIONS": 92399,
        "SESSIONS": 1885959
      },
      {
        "TRANSACTIONS": 133211,
        "SESSIONS": 3449525
      }
    ],
    "type": "scatter",
    "keys": {
      "x": "SESSIONS",
      "value": [
        "TRANSACTIONS"
      ]
    }
  },
  "chart": {
    "title": "Transactions x Session",
    "info": "January 01, 2020 to November 23, 2020"
  },
  "inCDA": true,
  "bindTo": "#chart_9xkm4m5zvov",
  "dashboardID": "rlj2acxu1xkhwrx7f2",
  "bindto": "#chart_9xkm4m5zvov",
  "color": {
    "pattern": [
      " #56a5bf",
      " #f2763d",
      " #8347cc",
      " #4cd97c",
      " #699bbf",
      " #d9d94c",
      " #30c2f2",
      " #d94cd4",
      " #bf5656",
      " #61f279",
      " #6cabd9",
      " #d9c84c",
      " #9573bf",
      " #91bf86",
      " #4c6fd9",
      " #56bf72",
      " #d96d4c",
      " #7dd94c",
      " #f26db4",
      " #babf56",
      " #8e3df2",
      " #bf7a73",
      " #73b9bf",
      " #4cb6d9",
      " #bf56bb"
    ]
  },
  "preserveaspectratio": true,
  "firstDraw": true
});
@netil netil added the question label Nov 25, 2020
@lgardner-condati
Copy link
Author

I see I forgot to mention that the $$ in $$.toggleShape(this, closest, closest.index); is defined as the circle clicked however it does not have a toggleShape attribute to be called.

Could a possible fix be to make the toggle Shape optional?

@netil netil added the bug label Dec 2, 2020
@netil
Copy link
Member

netil commented Dec 2, 2020

Hi @lgardner-condati, thanks for the report.

The issue is related with the issue #1619, where not covered for this issue.

@netil netil removed the question label Dec 2, 2020
netil added a commit to netil/billboard.js that referenced this issue Dec 2, 2020
Add condition to check $$.toggleShape to be run.

Ref naver#1795
@netil netil closed this as completed in 109c87d Dec 2, 2020
netil pushed a commit that referenced this issue Dec 4, 2020
# [2.2.0-next.1](2.1.4...2.2.0-next.1) (2020-12-04)

### Bug Fixes

* **axis:** rotated horizontal xAxisHeight is calculated correctly after loading new data ([ef2754f](ef2754f)), closes [#1786](#1786) [#1787](#1787)
* **eventRect:** fix data.onclick work for scatter/bubble ([109c87d](109c87d)), closes [#1795](#1795)

### Features

* **data:** Intent to ship data.label multiline ([8903aa6](8903aa6)), closes [#1784](#1784)
github-actions bot pushed a commit that referenced this issue Dec 24, 2020
# [2.2.0-next.1](2.1.4...2.2.0-next.1) (2020-12-24)

### Bug Fixes

* **axis:** rotated horizontal xAxisHeight is calculated correctly after loading new data ([ef2754f](ef2754f)), closes [#1786](#1786) [#1787](#1787)
* **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)
* **eventRect:** fix data.onclick work for scatter/bubble ([109c87d](109c87d)), closes [#1795](#1795)

### Features

* **data:** Intent to ship data.label multiline ([8903aa6](8903aa6)), closes [#1784](#1784)
* **gauge:** Intent to ship gauge.background ([632c600](632c600)), closes [#1804](#1804)
* **pie:** Intent to ship pie.outerRadius ([ca67418](ca67418)), closes [#1825](#1825)
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants