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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wincc-oa/wui-widgets

v2.0.1

Published

WinCC Open Architecture Dashboard project.

Readme

WinCCOA WebComponent Dashboard - Widgets Library

This package is part of the workspace for the WinCC Open Architecture WebComponent Dashboard, built using Lit and managed with Nx.

Usage information and reference details can be found in the WinCC OA documentation.

Dynamic Widget Loading

importWidgetModule() loads widgets using different strategies based on build configuration:

  • Dev mode: Relative imports (../wui-widget-${name}.ts)
  • Prod with externals: Namespaced imports via import map (@wincc-oa/wui-widgets/...)
  • Prod bundled: Relative imports

The strategy is automatically determined by vite.config.ts based on whether vendorExternals is configured

wui-widget-svg

Renders an SVG file and mutates it live from datapoint values: colors, fill levels, rotation, visibility, text content. A widget author supplies the SVG file plus a set of rules - no changes to wui-widget-svg.ts itself are needed per widget. Silo, pressure gauge, and traffic light dashboard widgets are built this way.

{
  "svgFile": "/data/WebUI/svg/silo.svg",
  "vars": [
    { "name": "min", "value": 0, "usage": "manual" },
    { "name": "max", "value": 200, "usage": "manual" }
  ],
  "rules": [
    {
      "operator": "hasAlert",
      "value": "",
      "actions": [{ "property": "fill", "selector": "#Shape_Alert", "value": "{alert_color}" }]
    }
  ]
}

Each rule is evaluated in order against the datapoint's current value; matching rules run their actions, each setting a property (a CSS style when the property starts with style., textContent for text, otherwise an attribute) on every SVG element matched by selector.

| Operator | Matches when | | -------------------------- | --------------------------------------- | | always | unconditionally | | is / isnot | value equals / does not equal | | smaller / smallerEqual | value is less than / at most | | greater / greaterEqual | value is greater than / at least | | between | value is within {from, to} | | contains | value contains a substring | | hasAlert / hasnotAlert | the datapoint has / has no active alert |

vars declares reusable placeholders for use in rule/action values. See the widget's own settings page for the full vars/rules field reference and examples.

Any {name} in a rule's value or an action's value is replaced before the rule runs: {value} is the datapoint's current value, {formatted_value} is its formatted string, {alert_color} is its active alert color, and any name declared in vars resolves to that variable's value. A var with usage: "OA" resolves from the linked datapoint's own attributes (min, max, unit, format, alertColor, value, name) instead of a fixed value.

wui-widget-svg only reacts to clicks that the SVG itself announces. Add an inline onclick to any element you want to be interactive - it dispatches a wui:svg-shape-click event named after the element's own id:

<g id="my-switch" onclick="dispatchEvent(new CustomEvent('wui:svg-shape-click', { bubbles: true, detail: { eventname: 'click-'+this.id, value: this.getAttribute('value') } }))">
  <!-- visible shape -->
</g>

wui-widget-svg re-dispatches that as a click-my-switch event on itself. Use that exact name as dpSet.event in the widget's datapoint config to write a value when the region is clicked - see @wincc-oa/wui-oarxjs-context's README, "data-point - Event-based writing (dpSet)", for the dpSet config shape. event is not limited to "change"/"click" - any string works, as long as it matches the name the SVG dispatches.

For a working example, see System1:grill1.command.throttle1 in the oa-grill widget's JSON (wc/oa-grill.widget.json in the WinCC OA project data) and the matching station-1-schalter element in its SVG file.

Not every SVG widget needs click handling. Silo, pressure gauge, and traffic light are read-only visualizations - rules alone drive their appearance, with no onclick in the SVG at all.

License

MIT