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

@city-ol/control-description-sheet

v1.0.6

Published

A web component to easily create control description sheets for orienteering courses.

Downloads

11

Readme

Control Description Sheet

npm (scoped)

A web component that allows you to easily create control description sheets for orienteering courses. Uses vector graphics. Check out this demo for an overview of the functionality.

Installation

Either install the package using npm

npm i @city-ol/control-description-sheet

or include the script:

<script
  type="module"
  src="https://unpkg.com/@city-ol/control-description-sheet/control-description-sheet.js"
></script>

Usage

This web component is made up of two distinct elements

  • The <control-description-sheet> element, which acts as the parent element and is given the information shown in the header and footer of the sheet as its attributes, i.e. the title (title), course name / number (course), total distance (distance), total elevation gain (elevation) and the distance to the final control (finalDistance).

  • Each control then corresponds to a <control-description> element. The control code must be passed as an attribute (code) and the control number is computed automatically. The subsequent columns can be filled with addtional information by specifying the attributes which, feature, appearance, dimensions, location and other. Valid values for these attributes are the keys of the SYMBOLS object inside the control-description-sheet.js file. These symbols were taken from the OpenOrienteering Mapper software. The row of a control can be highlighted by setting a highlighted attribute.

The control sheet from the example from above can thus be created as follows:

<control-description-sheet
  title="Brugg Kurz"
  course="kurz"
  distance="1.1&thinsp;km"
  finalDistance="160&thinsp;m"
>
  <control-description></control-description>
  <control-description code="46" feature="fence"></control-description>
  <control-description code="51" feature="crossing"></control-description>
  <control-description
    code="52"
    feature="crossing"
    location="north_end"
    appearance="stairway"
  ></control-description>
  <control-description code="40" feature="special_item_o"></control-description>
  <control-description code="39" feature="crossing"></control-description>
  <control-description
    code="38"
    appearance="linear_thicket"
    location="north_west_corner_inside"
    feature="building"
  ></control-description>
  <control-description
    code="63"
    location="south_corner_outside"
    feature="building"
  ></control-description>
  <control-description
    code="37"
    location="north_east_corner_outside"
    feature="linear_thicket"
  ></control-description>
</control-description-sheet>

Styling

The web component uses a shadow dom and should thus not be affected by the CSS on your website. Some basic styling can be made on the <control-description-sheet> element, which also affects the <control-description> elements. The supported CSS variables are --primary (sets the color of the text, icons and borders), --secondary (sets the highlighting color), --width (total width of the sheet) and --border-radius (only outermost border). Check out the demo to see how this looks like.

control-description-sheet {
  --primary: black;
  --width: 120px;
  --border-radius: 5px;
}

Credits

The icons for the description of individual controls are taken from the OpenOrienteering Mapper software, which is licensed under the GNU General Public License v3.0. No visual changes have been made, but the icons are stored in a modified format.

Contributing

To create the custom-elements.json file, run the following command:

npx web-component-analyzer analyze control-description-sheet.js --outFile custom-elements.json

License

This project is licensed under the GNU General Public License.