npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tangojs-web-components

v0.4.6

Published

Widgets collection for TangoJS.

Downloads

32

Readme

tangojs-web-components

tangojs-web-components is a collection of controls for tangojs. The controls are designed to work with any framework (or vanilla JS), and offer standard semantics of HTML*Element.

Installation

It's available in npmjs registry, just get it:

$ npm install tangojs-web-components

and drop desired components onto your page:

<link rel="import"
      href="node_modules/tangojs-web-components/dist/components/label.html">

Configuration

tangojs-web-components requires tangojs-core to be configured before any components are created. Example:

<!-- load scripts -->

<script type="text/javascript">
  (function () {
    var model = demoModel.createModel()
    var conn = new tangojsConnectorLocal.LocalConnector(model)
    tangojs.setConnector(conn)
  })()
</script>

<!-- import components -->
<!-- use components -->

Requirements

Components

All components are derived from HTMLElement. The behavior and layout depends on information received from underlying model (e.g. AttributeInfo object).

Label

Displays value of an read-only attribute. The attribute is polled at constant rate.

Examples

<tangojs-label
  model="my/dev/01/attr01"
  poll-period="1000"
  show-name
  show-unit>
</tangojs-label>

Attributes

Property | Type | Attribute | Remarks ----------- | ------- | ------------ | ------- model | string | model | Full attribute name. pollPeriod | number | poll-period | Poll period in milliseconds. showName | boolean | show-name | Should display name. showUnit | boolean | show-unit | Should display unit. showQuality | boolean | show-quality | Should display quality led.

LineEdit

Displays value of an writable attribute. The attribute is polled at constant rate.

Examples

<tangojs-line-edit
  model="my/dev/01/attr01"
  poll-period="1000"
  show-name
  show-unit>
</tangojs-line-edit>

Attributes

Property | Type | Attribute | Remarks ----------- | ------- | ------------ | ------- model | string | model | Full attribute name. pollPeriod | number | poll-period | Poll period in milliseconds. showName | boolean | show-name | Should display name. showUnit | boolean | show-unit | Should display unit. showQuality | boolean | show-quality | Should display quality led.

CommandButton

Executes command on the device. Takes arbitrary HTML nodes as children.

Examples

<tangojs-command-button
  model="my/dev/01/cmd01"
  parameters="6">
  Click Me!
</tangojs-command-button>

Attributes

Property | Type | Attribute | Remarks ---------- | -------- | ----------- | ------- model | string | model | Full command name. parameters | object | parameters | Parameters passed to the command.

Events

  • tangojs-command-result - fired when command result is available
    • event.detail.deviceData: DeviceData - result

Led

Displays device state.

Examples

<tangojs-state-led
  model="my/dev/01"
  poll-period="1000"
  show-name
  show-led>
</tangojs-state-led>

Attributes

Property | Type | Attribute | Remarks ---------- | ------- | ----------- | ------- model | string | model | Full device name. pollPeriod | number | poll-period | Poll period in milliseconds. showName | boolean | show-name | Should display name. showLed | boolean | show-led | Should display led.

Plot

TODO

Trend

Plots multiple attributes over time.

Examples

<tangojs-trend
  model="tangojs/test/dev1/sine_trend,tangojs/test/dev1/scalar"
  poll-period="1000"
  data-limit="5">
</tangojs-trend>

Attributes

Property | Type | Attribute | Remarks ---------- | -------- | ----------- | ------- model | string[] | model | Array of attribute names. pollPeriod | number | poll-period | Poll period in milliseconds. dataLimit | number | data-limit | Max no. of entries per dataset.

Remarks

tangojs-trend widget is built on top of Chart.js. You have to include dependencies manually:

<script src="node_modules/moment/min/moment.min.js"></script>
<script src="node_modules/chart.js/Chart.min.js"></script>

Chart

Visualizes spectrum attributes.

Examples

<tangojs-chart
  model="sys/tg_test/1/long_spectrum,sys/tg_test/1/double_spectrum"
  poll-period="1000">
</tangojs-chart>

Attributes

Property | Type | Attribute | Remarks ---------- | -------- | ----------- | ------- model | string[] | model | Array of attribute names. pollPeriod | number | poll-period | Poll period in milliseconds.

Remarks

tangojs-spectrum widget is built on top of Chart.js. You have to include dependencies manually:

<script src="node_modules/moment/min/moment.min.js"></script>
<script src="node_modules/chart.js/Chart.min.js"></script>

Image

[10-02-2017] @GregViguier and his team is currently working on this widget.

Form

Displays widgets for multiple attributes. Widgets are selected according to the attribute type.

Examples

<tangojs-form
  model="tangojs/test/dev1/sine_trend,tangojs/test/dev1/scalar"
  poll-period="1000">
</tangojs-form>

Attributes

Property | Type | Attribute | Remarks ---------- | -------- | ----------- | ------- model | string[] | model | Array of attribute names. pollPeriod | number | poll-period | Poll period in milliseconds.

DeviceTree

Displays devices, attributes and commands stored in database.

Examples

<tangojs-device-tree></tangojs-device-tree>

Attributes

None.

Events

  • selected - fires when element is selected (checked)
    • event.detail.selections
    • event.detail.selectionsAdded
    • event.detail.selectionsRemoved

API

  • getSelections(): Array<T>,
  • clearSelections(): undefined,
  • collapse(): undefined,
  • collapseAt(level: Number),
  • expand(): undefined.