New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flourish/info-popup

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flourish/info-popup

Popup with data insertion

  • 1.0.1
  • npm
  • Socket score

Version published
Weekly downloads
152
increased by50.5%
Maintainers
11
Weekly downloads
 
Created
Source

Flourish Info Popup

Enable popups with styling and data binding from Flourish

Install

npm install @flourish/info-popup

Initialization

The settings.yml file should be imported into your template’s template.yml file, like this:

  - Popups
  - property: mypopup
    import: "@flourish/info-popup"

var popup = Popup(state.mypopup, panel_container, popup_container) creates an Info Popup module with the defaults from state.mypopup. panel_container and popup_container are optional and are used to constrain the popup and panel.

Add column names to the popup by calling popup.addColumnNames(data.data.column_names).

Showing and hiding the Info Popup

You can specify specific user events when activating the Info Popup. So you only have to specify when the Info Popup was triggered by a click, clickout, mouse or mouseout - and the module will take care of sticky popups and when to enable/disable the panel.

popup.click(coords_or_node, data, id, callback) popup.clickout() popup.mouseover(coords_or_node, data, callback) popup.mouseout()

  • coords_or_node – can be an array with x, y coordinates or a Node element.
  • data – is an object with data to display in the popup.
  • id – is an id to remember which id should be made sticky

If the visibility of the popup is triggered by something other than a user event, you can user popup.update(coords_or_node, d, callback). This is useful for complex templates or when showing/hiding sticky popup values.

Positional methods

popup.popupDirections(directions) – gets or sets the popup directions.

popup.margins() – gets the space on the visualisation edges being used for the panel. This is useful for when you don't want the panel to overlay over the content.

Setting a title and subtitle

It's possible to choose a data point that should be treated as a title or subtitle. The title and subtitle have different visual weight from the rest of the content.

popup.titleKey(data_binding_name) popup.subtitleKey(data_binding_name)

Specifying a default template

It's also possible to specify a different template for the popup content. For instance if you want to add an tag or content needs to show in a specific order.

It's possible to pass in a default template when initializing the Info Popup. Adding data binding names between curly brackets, like {{name_of_data_binding}};

popup.popupDefaultTemplate(template_string) popup.panelDefaultTemplate(template_string)

FAQs

Package last updated on 04 Aug 2020

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