question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v0.6.0-beta.3 - Suggest to Add state to zoom event in ChartCanvas

See original GitHub issue

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… It would be nice to have this on “zoom” or even better a “zoomend” event… The zoom event currently just provides the mouseXY,currentCharts,currentItem

  componentDidMount() {
    var {canvas}=this.refs
    canvas.subscribe('canvasWidget', (eventType,chartProps,e)=> {
      this.eventChange(eventType,chartProps,e)
    });
  }
  /**
   * zoom,mousemove,draw,mouseleave,mouseenter,pan,panend
   * @param eventType
   * @param chartProps
   * @param e
   */
  eventChange(eventType,chartProps,e)
  {
    var {lastItemVisible}=this.state
    if (!isDefined(chartProps))
      return;
    switch (eventType){
      case 'panend':{
        var visibility= (dateAccessor(last(chartProps.plotData)) === dateAccessor(last(this.props.data)))
        if (lastItemVisible !== visibility)
        {
          //signal a change when the last item (most recent) changes visiblity
         console.log("lastItemVisible?",visibility)
        }
        break;
      }
    }
  }

 <ChartCanvas
            ref="canvas"
            ratio={ratio} width={width} height={height} type={type}
            margin={margin}
...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rragcommented, Nov 21, 2016

this is a little more complex than I though, how about this

https://github.com/rrag/react-stockcharts/blob/42a1695f5649d72ffda6df7fab381fdc8c92d74a/src/lib/ChartCanvas.jsx#L594

-each.callback(type, props, e);
+each.callback(type, props, { ...this.state, fullData: this.fullData }, e);

Where we add state and fullData as the 3rd argument and move e to 4th ?

0reactions
rragcommented, Nov 30, 2016

Changed again to go with initial approach of using state as third param and event as 4th

Read more comments on GitHub >

github_iconTop Results From Across the Web

Geographic availability for Zoom Events - Zoom Support
While access to Zoom Events is generally available worldwide, whether a user can Zoom Events is determined by which country or region the......
Read more >
Creating a recurring series event - Zoom Support
Zoom Events allows you to schedule a recurring series event on specific dates and times. Hosts can schedule events with multiple occurrences ...
Read more >
Using webhooks - Zoom App Marketplace
This webhook triggers when a user is created on a Zoom account that is subscribed to the User has been created event in...
Read more >
Creating a Zoom Event
When you create a single session event (non-recurring), select the event type as Single Session, and add the date and time of the...
Read more >
Zoom Webinars Plans & Pricing
Unlimited webinar sessions for up to 30 hours each; Brand your Zoom Webinars with a customized backsplash and control over speaker virtual backgrounds ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found