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

@butlerov-chemistry/vue

v0.1.7

Published

Butlerov 2D chemical drawing component for Vue.js

Readme

@butlerov-chemistry/vue

Vue 3 wrapper around @butlerov-chemistry/core.

Use it as a full-size chemical editor with:

  • native graph binding (v-model)
  • MOL string binding (v-model:mol)
  • style/theme customization
  • optional computed descriptors (mw, formula, formula_html, exact_mass)

Install

npm i @butlerov-chemistry/vue

Peer dependency: vue ^3.0.0.


Simplest Example

<template>
  <div class="editor">
    <VueButlerov v-model="graph" />
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import VueButlerov from "@butlerov-chemistry/vue";
import type { Graph } from "@butlerov-chemistry/core";

const graph = ref<Graph>({
  type: "Graph",
  vertices: [],
  edges: [],
});
</script>

<style scoped>
.editor {
  height: 420px;
  border: 1px solid #ddd;
}
</style>

Give the component container a non-zero height (height, flex layout, grid row, etc.).
VueButlerov fills container width/height.


Binding Modes

Use exactly one input channel at a time:

  • v-model (native graph/document)
  • v-model:mol (MOL string)

Native model (v-model)

<script setup lang="ts">
import { ref } from "vue";
import VueButlerov from "@butlerov-chemistry/vue";
import type { Graph } from "@butlerov-chemistry/core";

const graph = ref<Graph>({ type: "Graph", vertices: [], edges: [] });
</script>

<template>
  <div class="editor">
    <VueButlerov v-model="graph" />
  </div>
</template>

MOL model (v-model:mol)

<script setup lang="ts">
import { ref } from "vue";
import VueButlerov from "@butlerov-chemistry/vue";

const mol = ref("");
</script>

<template>
  <div class="editor">
    <VueButlerov v-model:mol="mol" />
  </div>
</template>

Style, Theme, and Settings

<script setup lang="ts">
import { ref } from "vue";
import VueButlerov from "@butlerov-chemistry/vue";
import { defaultStyle, type Graph, type Style } from "@butlerov-chemistry/core";

const graph = ref<Graph>({ type: "Graph", vertices: [], edges: [] });
const style = ref<Style>({
  ...defaultStyle,
  atom_font_size_px: 18,
  bond_thickness_px: 2,
  themes: defaultStyle.themes.map(t => ({ ...t })),
});
const theme = ref("dark");
const readonly = ref(false);
</script>

<template>
  <div class="editor">
    <VueButlerov
      v-model="graph"
      :style="style"
      :theme="theme"
      :disabled="readonly"
      :autofocus="true"
      :zoom-fit-padding="0.08"
      :copyable="true"
    />
  </div>
</template>

Descriptor API (Lazy + Debounced)

VueButlerov can compute descriptors and expose them via v-model:descriptors. Only requested keys are computed.

<script setup lang="ts">
import { ref } from "vue";
import VueButlerov from "@butlerov-chemistry/vue";
import type { Graph } from "@butlerov-chemistry/core";
import type { VueButlerovDescriptorValues } from "@butlerov-chemistry/vue";

const graph = ref<Graph>({ type: "Graph", vertices: [], edges: [] });
const descriptors = ref<VueButlerovDescriptorValues>({});
</script>

<template>
  <VueButlerov
    v-model="graph"
    :descriptor-keys="['mw', 'formula_html']"
    v-model:descriptors="descriptors"
    :descriptor-debounce-ms="{ mw: 120, formula_html: 40 }"
  />

  <p>MW: {{ typeof descriptors.mw === 'number' ? descriptors.mw.toFixed(2) : '' }}</p>
  <p v-html="descriptors.formula_html || ''"></p>
</template>

Supported keys:

  • mw
  • formula
  • formula_html
  • exact_mass

Props

| Prop | Type | Default | Description | |---|---|---|---| | modelValue | native model | undefined | Native input channel (v-model). | | mol | string | undefined | MOL input channel (v-model:mol). | | mode | "structure" \| "scheme" | "structure" | Editor mode. | | style | Style | defaultStyle | Drawing style object. | | theme | Theme \| string | "light" | Theme name/object. | | copyable | boolean | true | Show hover copy button. | | disabled | boolean | false | Read-only editor. | | autofocus | boolean | true | Focus stage on mount. | | zoomFitPadding | number | 0.05 | Extra zoom-to-fit margin ratio. | | descriptorKeys | descriptor key array | [] | Which descriptors to compute. | | descriptors | descriptor map | {} | v-model:descriptors value. | | descriptorDebounceMs | partial map | {} | Optional per-descriptor debounce override. |


Events

| Event | Payload | |---|---| | update:modelValue | native model | | update:mol | string | | update:descriptors | descriptor map | | error | Error |


Exposed Instance

VueButlerov exposes:

  • editor (MoleculeEditor)

Useful for advanced integration/tests.


Related