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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@myrmidon/cadmus-mat-physical-size

v9.0.11

Published

Cadmus - material description: physical size.

Readme

CadmusMatPhysicalSize

This project was generated using Angular CLI version 20.0.0.

PhysicalSizeComponent

This component allows you to edit a 2D or 3D physical size.

The component has two editing modes: textual and visual:

  • in textual mode, you just type the size following a conventional syntax, and parse it by clicking a button. If the text is valid, the visual counterpart will be automatically populated.
  • in visual mode, you edit each dimension value, unit, and tag, plus optionally the size's tag. Whenever you make a change in visual mode, the textual counterpart is updated.

In both modes, every change (i.e. saving text using the button in text mode, or just changing control values in visual mode) triggers an output event for the size being edited.

Note that depth is optional; when not set, its value will be displayed as 0 in the visual editor, and be missing from the text editor.

  • 🚩 cadmus-mat-physical-size
  • 🔑 PhysicalSizeComponent
  • 📚 thesauri:
    • physical-size-units (unitEntries)
    • physical-size-tags (tagEntries)
    • physical-size-dim-tags (dimTagEntries)
  • ▶️ input:
    • size (PhysicalSize)
    • defaultWUnit (string): default unit for width (default=cm).
    • defaultHUnit (string): default unit for height (default=cm).
    • defaultDUnit (string): default unit for depth (default=cm).
    • hBeforeW (boolean?): true if the height comes before the width (both in text and visual representation).
    • hideTag (boolean?)
  • 🔥 output:
    • sizeChange (PhysicalSize)

PhysicalDimensionComponent

This component allows you to edit a single physical dimension (value, unit, and optional tag).

  • 🚩 cadmus-mat-physical-dimension
  • 🔑 PhysicalDimensionComponent
  • 📚 thesauri:
    • physical-size-units (for unitEntries)
    • physical-size-dim-tags (for tagEntries)
  • ▶️ input:
    • dimension (PhysicalDimension)
    • disabled (boolean?)
    • hideTag (boolean?)
  • 🔥 output:
    • dimensionChange (PhysicalDimension)

PhysicalMeasurementSet

This component allows you to edit a set of physical measurements. For each one you specify a name (e.g. width, diagonal, volume, column, etc.) a value, a unit, and optionally a tag.

  • 🚩 cadmus-mat-physical-measurement-set
  • 🔑 PhysicalMeasurementSetComponent
  • 📚 thesauri:
    • physical-size-units (for unitEntries)
    • physical-size-dim-tags (for dimTagEntries)
    • physical-size-set-names (for nameEntries)
  • ▶️ input:
    • measurements (PhysicalMeasurement[])
    • allowCustomName (boolean?): true to allow users entering custom names for measurements, rather than only picking them from a dropdown.
    • defaultUnit (string)
  • 🔥 output:
    • measurementsChange (PhysicalMeasurement[])

PhysicalSizePipe

The PhysicalSizePipe is an Angular pipe that formats a PhysicalSize object into a human-readable string, displaying its width, height, and (optionally) depth, with their units.

Add the pipe to your template to display a formatted physical size:

<!-- Example usage in a template -->
<span>{{ size | physicalSize }}</span>

Parameters:

  • value (PhysicalSize): The physical size object to format.
  • hBeforeW (boolean, optional, default: false): If true, displays height -before width (e.g., "10 × 20 cm" instead of "20 × 10 cm").

Examples:

{{ size | physicalSize }}
<!-- e.g.: 20.00 × 10.00 × 5.00 cm -->

Height before width:

{{ size | physicalSize:true }}
<!-- e.g.: 10.00 × 20.00 × 5.00 cm -->

History

9.0.10

  • 2025-09-12: fix to default sizes.

9.0.9

  • 2025-09-10: set components change detection strategy to OnPush.

9.0.8

  • 2025-07-08: fixed unitDisabled (renamed from staticUnit).

9.0.7

  • 2025-07-07: added staticUnit property to physical dimension editor.

9.0.6

  • 2025-07-04: refactored PhysicalDimensionComponent. This was not used, and has been refactored to provide an editor for single dimensions.

9.0.5

  • 2025-06-14:
    • fixes to physical size parser toString.
    • more tests for physical size parser.

9.0.4

  • 2025-06-13: set text after form update in size.

9.0.3

  • 2025-06-13: refactored physical size.
  • 2025-01-27: fix to physical measurement set.