cancel
Showing results for 
Search instead for 
Did you mean: 

Lumira 1.25 VizPacker - Exposing Properties

mike_howles4
Active Contributor
0 Kudos

Hey guys,

I'm trying to see if it's possible to expose visualization properties (not data like Dimensions or Measures) in my VizPacker extension.

I have a visualization where I'd like the user to be able to control the cluster radius of the plot area.  This property should not be databound but exposed as configurable by the user in some means.  I see spots where it appears there might be a path, but if see, I am unsure on how to define the properties in my extension.

In flow.js I've tried something like this:


element.addProperty({

            name: "colorPalette",

            type: "StringArray",

            supportedValues: "",

            defaultValue: d3.scale.category20().range().concat(d3.scale.category20b().range()).concat(d3.scale.category20c().range())

        });

       

        // Radius Attempt

        element.addProperty({

            name : "radius",

            type : "Integer",

            defaultValue : 15

        });

This allows me to access the radius property in render.js like this:  (examples in lines 4 and 12).


console.log(that.width()+","+that.height());

            console.log(points.length);

            console.log(JSON.stringify(that.properties()));

            this.hexbin = d3.hexbin().size([that.width(),that.height()]).radius(that.properties().radius);

            this.hexbins = this.hexbin(points);

            var max = d3.median(this.hexbins,function(d){

                return d.length;

            }) * 2;

            var min = 0;

  var colorRange = d3.scale.quantize()

                .domain([min,max])

                .range(that.properties().colorPalette);

The color palette (driven by Lumira in the overall theme properties) gets applies and the radius of 15 from flow.js is applied, but is there a way to expose the radius property within the Visualize Room or Compose Room?

Thanks for any help!

Accepted Solutions (1)

Accepted Solutions (1)

mike_howles4
Active Contributor
0 Kudos

Answers (0)