personality-insights-nodejs icon indicating copy to clipboard operation
personality-insights-nodejs copied to clipboard

ReactJS friendly version?

Open michaelgriffithus opened this issue 7 years ago • 2 comments

Is there any way you can provide a ReactJS (16.x) friendly version, or provide guidance on how to convert/use the graph with ReactJS?

michaelgriffithus avatar Aug 16 '18 17:08 michaelgriffithus

I guess you are talking about the Sunburst. Maybe you can look for that chart in the react-d3 library. We don't have this on our roadmap for this year.

germanattanasio avatar Aug 16 '18 17:08 germanattanasio

Take a look at personality-sunburst-chart. It's not React specific but you can easily wrap it in a component:

import React, {useEffect, useRef} from 'react';
import PersonalitySunburstChart from 'personality-sunburst-chart/lib/charts/v3-d3v4';

export default function PersonalityInsightsChart({data}) {
  const chartRef = useRef(null);
  useEffect(() => {
    const chart = new PersonalitySunburstChart({
      element: chartRef.current,
      version: 'v3'
    });

    chart.show(data);
  }, [data]);

  return (<div ref={chartRef} />);
}

mwadden avatar Feb 07 '20 19:02 mwadden