1.1.0 • Published 8 years ago

@domoinc/single-line-text v1.1.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
8 years ago

SingleLineText

A single line of text

Configuration Options

alignment

Type: select
Default: {"name":"Center","value":"middle"}

This widget's horizontal alignment is based off of the chart bounds layer. This layer is visible once the widget has been added to an illustrator art board. The widget can either draw to the left or right of the chartBounds layer, or the text can be centered about the chartBounds layer.

chartName

Type: string
Default: "SingleLineText"

Name of chart for Reporting.

height

Type: undefined
Default: undefined

isOnMobile

Type: boolean
Default: false

If true, it signals to the widget that it is running on a mobile device. Should be called before draw and then NEVER changed.

shouldValidate

Type: boolean
Default: true

Flag for turning off data validation

textColor

Type: color
Default: "#333333"

textFontFamily

Type: string
Default: "Open Sans"

textFontWeight

Type: select
Default: {"name":"300 - Light","value":300}

Greater values correspond to increased font boldness (some fonts do not support every value)

textSize

Type: number
Default: 36
Units: px

tooltipBackgroundColor

Type: color
Default: "#555555"

Background color for the tooltip

tooltipTextColor

Type: color
Default: "#FFFFFF"

Font color for the tooltip text

tooltipTextSize

Type: number
Default: 14
Units: px

undefined

updateSizeableConfigs

Type: boolean
Default: true

Flag for turning off the mimic of illustrator's scale functionality

width

Type: number
Default: 247
Units: px

Width of the widget

Data Definition

Label

Type: string

Default validate:

function validate(d) {
	          return this.accessor(d) !== undefined;
	        }

Default accessor:

function accessor(line) {
	          return line[0] === undefined ? undefined : String(line[0]);
	        }

Events

Dispatch Events

External Events

Example

/*----------------------------------------------------------------------------------
 Create Widget -> index.html

 © 2011 - 2015 DOMO, INC.
 ----------------------------------------------------------------------------------*/

//Setup some fake data
var data = [
  ['Top Sales Reps']
];

//Initialze the widget
var chart = d3.select('#vis')
  .append('svg')
  .attr({
    height: '500px',
    width: '500px'
  })
  .append('g')
  .attr('transform', 'translate(250,230)')
  .chart('SingleLineText')
  .c({
    width: 500,
    height: 500,
  });

//Render the chart with data
chart._notifier.showMessage(true);
chart.draw(data);