Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@domoinc/dropdown

Package Overview
Dependencies
Maintainers
17
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domoinc/dropdown

Dropdown - Domo Widget

  • 2.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
17
Weekly downloads
 
Created
Source

Dropdown

Configuration Options

chartName

Type: string
Default: "Dropdown"

Name of chart for Reporting.

domoScroll

Type: boolean
Default: false

Turn on domo Scroll?

height

Type: string
Default: "200px"

Max Height of the dropdown

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.

listIconFunction

Type: function
Default: "function () {}"

Function that runs on every list element

listIconPadding

Type: number
Default: 0

Padding for the list icons

selectedIndex

Type: number
Default: 0

Selected Index

selectedValue

Type: string
Default: "ConfigValue"

selectedValue

shouldValidate

Type: boolean
Default: true

Flag for turning off data validation

size

Type: string
Default: "medium"

Size of the dropdown.

updateSizeableConfigs

Type: boolean
Default: true

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

visible

Type: boolean
Default: true

Show/Hide the dropdown.

width

Type: string
Default: "250px"

Width of the dropdown

Data Definition

Label

Type: string

Default validate:

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

Default accessor:

function (line) { return String(line[0]); }
Value

Type: string

Default validate:

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

Default accessor:

function (line) { return String(line[1]); }

Events

Dispatch Events
External Events

Example

//Setup some fake data
var data = [
    ['1'],
    ['Domo', 'value', 'otherfield', 'bunchafields', 'onthisguy'],
    ['Widgetasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['Test'],
    ['End'],
];

//Initialze the widget
var chart = d3.select("#vis").append('div')
    .style({
        'position':'absolute',
        'top':'100px',
        'left':'100px'
    })
    .chart("Dropdown")
    .c({
        width: '250px',
        // height: '250px',
        'size': 'large',
        domoScroll: true
    })
    // .selectedIndex(1);

chart.c('listIconFunction', function(iconDiv, d, i) {
    iconDiv.append('img')
        .attr({
            src: 'https://avatars0.githubusercontent.com/u/7373982?v=3&s=40'
        })
        .style({
            height: '16px',
            width: '16px',
        })
})

//Render the chart with data
chart.draw(data);

// setTimeout(function() {
//     chart.c('domoScroll', false)
//     chart.draw(data)
// }, 2000)

chart.on('click', function(d, i) {
    this.toggleVisibility();
    console.log(d)
});

//******************************************************************
//This is the code that allows you to put icons on the list items
//******************************************************************

d3.select('#vis')
    .append('div')
    .style({
        height: '100px',
        width: '100px',
        'background': '#BADA55',
        'position': 'absolute',
        'left': '400px'
    })
    .on('click', function() {
    chart.toggleVisibility();
        //chart.trigger('visibility');
    });

Keywords

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc