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

@artidev/odontogram-core

v0.1.1

Published

Low-level odontogram runtime for custom integrations.

Readme

@artidev/odontogram-core

Low-level odontogram runtime for custom integrations.

Use this package when you want direct control over the runtime instance, state import/export, and bundled SVG assets. If you use Vue and want the easiest setup, use @artidev/vue-odontogram instead.

Quick path

  1. Install the package.
  2. Create a root element that contains the runtime hooks your wrapper needs.
  3. Create an instance, call init(), and listen to onChange.
npm install @artidev/odontogram-core

What this package includes

  • Runtime instance API.
  • Full-state import/export.
  • Readonly toggling.
  • Default tooth and icon SVG assets.
  • Asset override support.

Important before you use it

This package is intentionally low-level.

  • It is not a drop-in component.
  • It expects your integration to provide the DOM structure the runtime binds to.
  • The Vue package already ships that structure for you.

If you want the fastest path, use @artidev/vue-odontogram.

Exports

| Export | Description | |--------|-------------| | createOdontogramInstance | Creates a runtime instance bound to a root element | | defaultAssets | Bundled asset URLs for teeth, occlusal templates, and icons |

API

createOdontogramInstance(rootEl, options)

Creates one isolated runtime instance.

| Option | Type | Description | |--------|------|-------------| | onChange | (state) => void | Called with the full serialized state after a change | | readOnly | boolean | Starts the runtime in readonly mode | | assets | object | Overrides default SVG assets |

Instance methods

| Method | What it does | |--------|--------------| | init() | Builds the chart UI inside the root | | destroy() | Clears grid bindings and runtime state | | importState(data) | Replaces the entire chart state | | exportState() | Returns the current serialized chart state | | setReadOnly(value) | Enables or disables editing |

State behavior

  • importState(data) is a full replacement, not a partial patch.
  • Missing items in an imported state fall back to defaults.
  • exportState() always returns the full chart state.

Assets

The package bundles default SVG assets.

You can read them from defaultAssets and override them in createOdontogramInstance() if you need your own visual set.

import { defaultAssets } from '@artidev/odontogram-core'

console.log(defaultAssets.icons.occlusal)
console.log(defaultAssets.teeth[11])

Example: create an instance

This is the runtime API shape.

import { createOdontogramInstance } from '@artidev/odontogram-core'

const root = document.getElementById('odontogram-root')

if (!root) {
  throw new Error('Missing #odontogram-root')
}

const instance = createOdontogramInstance(root, {
  readOnly: false,
  onChange(state) {
    console.log('Updated state', state)
  },
})

await instance.init()

Example: load saved state

instance.importState({
  11: { toothSelection: 'implant' },
  21: { toothSelection: 'tooth-base', crownMaterial: 'zircon' },
})

Example: export state

const state = instance.exportState()
localStorage.setItem('odontogram-state', JSON.stringify(state))

Example: toggle readonly mode

instance.setReadOnly(true)

Who should use this package?

  • Teams building their own wrapper around the runtime.
  • Teams that need asset overrides.
  • Teams integrating outside Vue.

Who should not use this package directly?

  • Apps that just need a working component quickly.
  • Teams that do not want to maintain runtime markup hooks.

In those cases, use @artidev/vue-odontogram.

Repository

https://github.com/ArnoldOlanda/odontogram-packages

License

MIT