This message was deleted.
# help
s
This message was deleted.
👀 1
a
When you indicate that you have embedded in a React app, how did you do this? I just tried downloading the code and dropping it into GitHub and the interactive tips work: https://aaronkyle.github.io/dataviz/wbg-pip-shared-prosperity/index.html
Here's the Plot example that you linked for good measure: https://aaronkyle.github.io/dataviz/plot-line-chart-interactive-tip/index.html
m
Is it possible you have an old version of Plot installed? You’ll need 0.6.7 or later for the tip mark.
d
That worked for me recently in a React app. I updated Plot to v0.6.8 and tooltips were displaying on a bar chart.
1
e
Thanks all! @aaronkyle I'm embedding using the "Runtime with React" embed code from Embed helper. Ie:
Copy code
import React, {useRef, useEffect} from "react";
import {Runtime, Inspector} from "@observablehq/runtime";
import notebook from "063ec903459cbc40";

function Notebook() {
  const stockChartRef = useRef();

  useEffect(() => {
    const runtime = new Runtime();
    runtime.module(notebook, name => {
      if (name === "stockChart") return new Inspector(stockChartRef.current);
    });
    return () => runtime.dispose();
  }, []);

  return (
    <>
      <div ref={stockChartRef} />
      <p>Credit: <a href="<https://observablehq.com/d/063ec903459cbc40@23>">Plot: Line chart, interactive tip by Thrive Capital</a></p>
    </>
  );
}

export default Notebook;
Let me see if I can update the Plot version or replicate issue with a toy app.
👍🏻 1
a
I tried the links in your code snippet and found them to be private. Are you embedding using private links and the API key, for example: https://api.observablehq.com/d/a11d1e2cd588428e@5.js?v=3&amp;api_key=MYSECRETAPIKEY. If so - how are you enjoying the feature?
<3
The auto-generated embed code snippets are working well for me. Along the lines of Mike's suggestions, maybe an old version of the CSS or inspector are loaded in somewhere.
e
Yes! using the private links and the API keys. Feature is great! Definitely so much easier for my production use case!
💖 1
Also just did a toy
create-react-app
with the Plot chart and tooltips are working for me. So will dig into older versions being loaded somewhere.
💖 1
Thank you all for your help
🙏 1
Should've done the toy example investigation first...
Fixed! I needed to upgrade the
@observable/runtime
from
5.7.0
to
5.7.4
. Thank you!
1
👍 1