{"action":"created","issue":{"url":"https://api.github.com/repos/rrag/react-stockcharts/issues/159","repository_url":"https://api.github.com/repos/rrag/react-stockcharts","labels_url":"https://api.github.com/repos/rrag/react-stockcharts/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/rrag/react-stockcharts/issues/159/comments","events_url":"https://api.github.com/repos/rrag/react-stockcharts/issues/159/events","html_url":"https://github.com/rrag/react-stockcharts/issues/159","id":186014955,"number":159,"title":"v0.6.0-beta.3 - Suggest to Add state to zoom event in ChartCanvas","user":{"login":"itsjimbo","id":11524813,"avatar_url":"https://avatars.githubusercontent.com/u/11524813?v=3","gravatar_id":"","url":"https://api.github.com/users/itsjimbo","html_url":"https://github.com/itsjimbo","followers_url":"https://api.github.com/users/itsjimbo/followers","following_url":"https://api.github.com/users/itsjimbo/following{/other_user}","gists_url":"https://api.github.com/users/itsjimbo/gists{/gist_id}","starred_url":"https://api.github.com/users/itsjimbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsjimbo/subscriptions","organizations_url":"https://api.github.com/users/itsjimbo/orgs","repos_url":"https://api.github.com/users/itsjimbo/repos","events_url":"https://api.github.com/users/itsjimbo/events{/privacy}","received_events_url":"https://api.github.com/users/itsjimbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-28T20:31:20Z","updated_at":"2016-11-21T15:57:34Z","closed_at":null,"body":"Just wondering as a suggestion to add state to zoom or other events, in the example below, an event is triggered when the last item becomes visible on \"panend\" event..\nIt would be nice to have this on \"zoom\" or even better a \"zoomend\" event...\nThe zoom event currently just provides the mouseXY,currentCharts,currentItem\n\n```\n  componentDidMount() {\n    var {canvas}=this.refs\n    canvas.subscribe('canvasWidget', (eventType,chartProps,e)=> {\n      this.eventChange(eventType,chartProps,e)\n    });\n  }\n```\n\n```\n  /**\n   * zoom,mousemove,draw,mouseleave,mouseenter,pan,panend\n   * @param eventType\n   * @param chartProps\n   * @param e\n   */\n  eventChange(eventType,chartProps,e)\n  {\n    var {lastItemVisible}=this.state\n    if (!isDefined(chartProps))\n      return;\n    switch (eventType){\n      case 'panend':{\n        var visibility= (dateAccessor(last(chartProps.plotData)) === dateAccessor(last(this.props.data)))\n        if (lastItemVisible !== visibility)\n        {\n          //signal a change when the last item (most recent) changes visiblity\n         console.log(\"lastItemVisible?\",visibility)\n        }\n        break;\n      }\n    }\n  }\n\n```\n\n```\n <ChartCanvas\n            ref=\"canvas\"\n            ratio={ratio} width={width} height={height} type={type}\n            margin={margin}\n...\n```\n"},"comment":{"url":"https://api.github.com/repos/rrag/react-stockcharts/issues/comments/261978751","html_url":"https://github.com/rrag/react-stockcharts/issues/159#issuecomment-261978751","issue_url":"https://api.github.com/repos/rrag/react-stockcharts/issues/159","id":261978751,"user":{"login":"rrag","id":10691183,"avatar_url":"https://avatars.githubusercontent.com/u/10691183?v=3","gravatar_id":"","url":"https://api.github.com/users/rrag","html_url":"https://github.com/rrag","followers_url":"https://api.github.com/users/rrag/followers","following_url":"https://api.github.com/users/rrag/following{/other_user}","gists_url":"https://api.github.com/users/rrag/gists{/gist_id}","starred_url":"https://api.github.com/users/rrag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrag/subscriptions","organizations_url":"https://api.github.com/users/rrag/orgs","repos_url":"https://api.github.com/users/rrag/repos","events_url":"https://api.github.com/users/rrag/events{/privacy}","received_events_url":"https://api.github.com/users/rrag/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T15:57:34Z","updated_at":"2016-11-21T15:57:34Z","body":"this is a little more complex than I though, how about this\r\n\r\nhttps://github.com/rrag/react-stockcharts/blob/42a1695f5649d72ffda6df7fab381fdc8c92d74a/src/lib/ChartCanvas.jsx#L594\r\n\r\n```diff\r\n-each.callback(type, props, e);\r\n+each.callback(type, props, { ...this.state, fullData: this.fullData }, e);\r\n```\r\n\r\nWhere we add state and fullData as the 3rd argument and move `e` to 4th ?"}}
{"actor":{"display_login":"rrag"}}