syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

Add public function to compute centroids on real axis #318

Closed m1neral closed 8 years ago

m1neral commented 8 years ago

This public function can help use this example https://gist.github.com/mostaphaRoudsari/b4e090bb50146d88aec4 with original source d3.parcoords.js

To get centroid points used in highlight when mouse-over and render tooltip:

        function getCentroids() {
            const margins = this.chart.margin();
            const brushedData = this.chart.brushed().length ? this.chart.brushed() : this.data;

            return brushedData.map(d => {
                const centroidPoints = this.chart.compute_real_centroids(d);
                return centroidPoints.map(d => [d[0] + margins.left, d[1] + margins.top]);
            });
        }

refs #32

foxbat07 commented 8 years ago

Thank you @syntagmatic ! It would be great if there was an example to use this as a reference.

Mohit

m1neral commented 7 years ago

@mohithingorani Added. Apologies for global instances and no encapsulation (it's example).

jcrichard commented 7 years ago

Thank you @syntagmatic @m1neral . Smoothness option not working with highlight ?

m1neral commented 7 years ago

@jcrichard I haven't used smoothness in my examples, but suppose there is no connection between this option and highlighting lines.

jcrichard commented 7 years ago

@m1neral I mean I affirm it is not working.

jcrichard commented 7 years ago

@m1neral . Did you try the option ? I can(t figure out how it is possible the option works. Thank you