Skip to content

Instantly share code, notes, and snippets.

@jongio
Last active May 10, 2017 16:25
Show Gist options
  • Select an option

  • Save jongio/99494592e71ff34ad9ae586b99d3f929 to your computer and use it in GitHub Desktop.

Select an option

Save jongio/99494592e71ff34ad9ae586b99d3f929 to your computer and use it in GitHub Desktop.
module powerbi.extensibility.visual {
export class Visual implements IVisual {
private target: HTMLElement;
private settings: VisualSettings;
private svg: d3.Selection<SVGElement>;
constructor(options: VisualConstructorOptions) {
let svg = this.svg = d3.select(options.element)
.append('svg').classed('liquidFillGauge', true);
this.svg.append("circle")
.attr("cx", 50)
.attr("cy", 50)
.attr("r", 50)
.style("fill", 'green');
}
public update(options: VisualUpdateOptions) {
}
public destroy(): void {
}
private static parseSettings(dataView: DataView): VisualSettings {
return VisualSettings.parse(dataView) as VisualSettings;
}
/**
* This function gets called for each of the objects defined in the capabilities files and allows you to select which of the
* objects and properties you want to expose to the users in the property pane.
*
* Below is a code snippet for a case where you want to expose a single property called "lineColor" from the object called "settings"
* This object and property should be first defined in the capabilities.json file in the objects section.
*/
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] | VisualObjectInstanceEnumerationObject {
return VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment