plotly / plotly/react-plotly.js

how to use modebar buttons handlers

オープン
#100 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.1k
フォーク
138
平均マージ
3日 2時間
マージ済み PR(30日)
4

説明

I am using "react-plotly.js": "^2.2.0" ,

  1. I am using react Image component
  2. on click of image i am calling ResetOnly(event) {
    var plotDiv = document.getElementsByClassName('plot-chart-class1');
    //var button = event.currentTarget;
    // button.setAttribute('data-attr', 'zoom');
    // button.setAttribute('data-val', 'reset');
    ModeBarButtons.zoomIn2d.click(plotDiv[0], event);
    }
  3. i have imported import ModeBarButtons from 'plotly.js/src/components/modebar/buttons.js';
  4. I am getting this error
    registry.js:221 Uncaught TypeError: Cannot read property 'apply' of undefined
    at Object.exports.call (registry.js:221)
    at Object.handleCartesian [as click] (buttons.js:264)
    at PlotlyChart.ResetOnly (PlotlyChart.jsx:342)
    at HTMLUnknownElement.boundFunc (ReactErrorUtils.js:63)
    at Object.ReactErrorUtils.invokeGuardedCallback (ReactErrorUtils.js:69)
    at executeDispatch (EventPluginUtils.js:83)
    at Object.executeDispatchesInOrder (EventPluginUtils.js:106)
    at executeDispatchesAndRelease (EventPluginHub.js:41)
    at executeDispatchesAndReleaseTopLevel (EventPluginHub.js:52)
    at Array.forEach ()
  5. In registry.js file, in below function exports.apiMethodRegistry[name] is undefined
    exports.call = function() {
    var name = arguments[0];
    var args = [].slice.call(arguments, 1);
    return exports.apiMethodRegistry[name].apply(null, args);
    };
    can someone help me to resolve this issue

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、説明されている react-plotly.js のセットアップを使って、PlotlyChart.jsx の modebar ボタンのクリックを再現します。plotly.js/src/components/modebar/buttons.js と registry.js の失敗している呼び出しの周辺を読み、参照されている API メソッドが undefined である理由を特定します。完了条件は、registry エラーなしで handler が実行されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
data-visualization, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。