personality-insights / sunburst-chart

A visualization for IBM Watson Personality Insights service output.
https://personality-insights.github.io/sunburst-chart/
Apache License 2.0
43 stars 37 forks source link

Issue when integrating with webpack #12

Closed soumak77 closed 7 years ago

soumak77 commented 7 years ago

I'm attempting to integrate this library into a project using angular2 built with webpack and typescript (generated via angular-cli). I have successfully integrated the sunburst chart using the standalone version which adds PersonalitySunburstChart to the window object. I want to take a more modular approach and not use the window object but I cannot get the library imported using webpack.

The following should work to include the library via webpack: import * as PersonalitySunburstChart from 'personality-sunburst-chart';

germanattanasio commented 7 years ago

We are working on this as part of #11.

germanattanasio commented 7 years ago

@soumak77 try to use lib/index.js. I think you will still run into issues because the library expects d3 and jquery to be available

soumak77 commented 7 years ago

@germanattanasio I removed the jquery dependency with https://github.com/personality-insights/sunburst-chart/issues/5, any reason the dependency was reintroduced?

germanattanasio commented 7 years ago

OMG! you are right. I looked at your PR and reintroduced the changes removing jquery. You should also be able to use DOM nodes and class selector like .my-class.

2.0.3 has the changes.