Skip to Content

Lumira 1.25 VizPacker - Exposing Properties

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 17, 2015 at 03:49 PM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.