Socket
Book a DemoInstallSign in
Socket

@paraboly/pwc-map-legend

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paraboly/pwc-map-legend

Fully customizable map legend view for Web with StencilJS via Paraboly

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Built With Stencil

WebComponent Map Legend

Fully customizable map legend view for Web with StencilJS via Paraboly

npm version npm Platform - Platform Free Web License: MIT

WebComponent Map Legend WebComponent Map Legend WebComponent Map Legend Example with Road Lanes and Overlay Text

Live JSFiddle Example

Installation

Script tag

  • Publish to NPM
  • Put a script tag similar to this <script type="module" src="https://unpkg.com/@paraboly/pwc-map-legend@latest/dist/pwc-map-legend/pwc-map-legend.esm.js"></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install @paraboly/pwc-map-legend --save
  • Add an import to the npm packages import @paraboly/pwc-map-legend;
  • Then you can use the element anywhere in your template, JSX, html etc

Usage

HTML Tag Prop Way

<pwc-map-legend
  title-text="Custom Legend Title"
  entries='[
    {
      "name": "Foo",
      "count": 1512,
      "color": "red"
    },
    {
      "name": "Road",
      "count": 8,
      "color": "#222123",
      "svgStyle": { "stroke-opacity": 0.8, "stroke-width": 15 },
      "roadLines": [
        {
          "color": "white",
          "svgStyle": { "stroke-dasharray": 6 }
        },
        {
          "color": "white"
        }
      ]
    }
  ]'
></pwc-map-legend>

Javascript Way

<pwc-map-legend></pwc-map-legend>
var pwcMapLegend = document.querySelector("pwc-map-legend");
pwcMapLegend.titleText = "Legend";
pwcMapLegend.entries = [
  {
    name: "Foo",
    count: 1512,
    color: "red"
  },
  {
    name: "Triple Lane Road",
    count: 8,
    color: "#222123",
    svgStyle: { "stroke-opacity": 0.8, "stroke-width": 15 },
    roadLines: [
      {
        color: "white",
        svgStyle: { "stroke-dasharray": 6 }
      },
      {
        color: "white"
      }
    ]
  }
];

Caveats

  • stroke-width of svgStyle overrides has to be of type number only. This is enforced in TypeScript interfaces, but there is no type enforcement when used from JavaScript code or from plain HTML.

Authors

License

WebComponent PWC Map Legend is available under the MIT license. Refer to the LICENSE file for more information.

FAQs

Package last updated on 25 Nov 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.