How to use the vega-tooltip.vega function in vega-tooltip

To help you get started, we’ve selected a few vega-tooltip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vega / voyager / src / components / vega-lite / index.tsx View on Github external
//   "encoding": {
    //     "x": {"field": "a", "type": "quantitative"},
    //     "y": {"field": "b", "type": "quantitative"}
    //   }
    // };
    const {logger} = this.props;
    const vlSpec = this.props.spec;
    try {
      const spec = vl.compile(vlSpec, logger).spec;
      const runtime = vega.parse(spec, vlSpec.config);
      this.view = new vega.View(runtime)
        .logLevel(vega.Warn)
        .initialize(this.refs[CHART_REF] as any)
        .renderer(this.props.renderer || 'canvas')
        .hover();
      vegaTooltip.vega(this.view);
      this.bindData();
    } catch (err) {
      logger.error(err);
    }
  }
github cdapio / cdap / cdap-ui / app / cdap / components / VegaLiteChart / index.js View on Github external
if (this.props.width) {
        if (typeof this.props.width === 'function') {
          vlSpec.width = this.props.width(dimension, this.state.data);
        } else {
          vlSpec.width = this.props.width;
        }
      }
      const spec = vl.compile(vlSpec).spec;
      const runtime = vega.parse(spec);
      this.view = new vega.View(runtime)
        .logLevel(vega.Warn)
        .initialize(el)
        .renderer('svg')
        .hover();
      if (this.props.tooltipOptions && Object.keys(this.props.tooltipOptions).length) {
        vegaTooltip.vega(this.view, this.props.tooltipOptions);
      } else {
        vegaTooltip.vega(this.view);
      }
      this.bindData();
    } catch (err) {
      console.log('ERROR: Failed to compile vega spec ', err);
    }
  };
github commaai / cabana / src / components / CanHistogram.js View on Github external
onHistogramViewAvailable(view) {
        this.view = view;
        const {binDuration} = this.state.bins;
        const options = {showAllFields: false,
                         fields: [{field: 'count'}, {field: 'relStartTime', title: `from`}],
                         colorTheme: 'dark'}

        VegaTooltip.vega(view, options);
    }
github apple / turicreate / src / visualization / Turi Create Visualization / src / user_interface / src / elements / Plot / Chart / index.js View on Github external
this.vega_json = spec;
        this.vega_json.autosize = {"type": "fit", "resize": true, "contains": "padding"};

        if(this.vega_json["metadata"] != null){
            if(this.vega_json["metadata"]["bubbleOpts"] != null){
                this.bubbleOpts = this.vega_json["metadata"]["bubbleOpts"];
            }
        }

        this.vegaLoading = true;
        this.vegaView = new vega.View(vega.parse(this.vega_json), {'renderer': 'svg'})
                                .initialize(this.vega_container)
                                .hover()
                                .run();
        this.vegaLoading = false;
        vegaTooltip.vega(this.vegaView, this.bubbleOpts);
        
        if(window.navigator.platform === 'MacIntel'){
            window.webkit.messageHandlers["scriptHandler"].postMessage({status: 'ready'});
        }
    }
github vega / vega-editor / src / components / renderer / renderer.js View on Github external
runtime = vega.parse(props.vegaSpec);
    view = new vega.View(runtime)
      .logLevel(vega.Warn)
      .initialize(this.refs.chart)
      .renderer(props.renderer)

    if (props.mode === MODES.Vega) {
      view.hover()
    }

    view.run();

    this.refs.chart.style.width = 'auto';

    if (this.props.tooltip) {
      vegaTooltip.vega(view);
    }

    window.VEGA_DEBUG.view = view;
  }
github apple / turicreate / src / visualization / client / Turi Create Visualization / src / user_interface / src / elements / Plot / Chart / index.js View on Github external
this.vega_json = spec;
        this.vega_json.autosize = {"type": "fit", "resize": true, "contains": "padding"};

        if(this.vega_json["metadata"] != null){
            if(this.vega_json["metadata"]["bubbleOpts"] != null){
                this.bubbleOpts = this.vega_json["metadata"]["bubbleOpts"];
            }
        }

        this.vegaLoading = true;
        this.vegaView = new vega.View(vega.parse(this.vega_json), {'renderer': 'svg'})
                                .initialize(this.vega_container)
                                .hover()
                                .run();
        this.vegaLoading = false;
        vegaTooltip.vega(this.vegaView, this.bubbleOpts);

        if(window.navigator.platform === 'MacIntel' && !window.tcvizBrowserMode){
            window.webkit.messageHandlers["scriptHandler"].postMessage({status: 'ready'});
        }
    }

vega-tooltip

A tooltip plugin for Vega-Lite and Vega visualizations.

BSD-3-Clause
Latest version published 9 months ago

Package Health Score

82 / 100
Full package analysis