Skip to content

implement datamatrix 2D code#127

Open
bfour wants to merge 3 commits into
MultiMote:devfrom
bfour:add-datamatrix
Open

implement datamatrix 2D code#127
bfour wants to merge 3 commits into
MultiMote:devfrom
bfour:add-datamatrix

Conversation

@bfour

@bfour bfour commented Apr 3, 2026

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces DataMatrix (2D) code support in the label designer by adding a new Fabric object implementation and wiring it into canvas utilities and the Svelte UI.

Changes:

  • Added a new DataMatrix Fabric object rendered via bwip-js.
  • Integrated DataMatrix into object creation, canvas preprocessing/scale rules, and designer panels.
  • Updated dependencies (added bwip-js + typings) and introduced a yarn.lock.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Adds a Yarn lockfile containing the resolved dependency graph.
package.json Adds bwip-js and @types/bwip-js dependencies.
src/fabric-object/datamatrix.ts Implements a new Fabric object that renders DataMatrix codes using bwip-js.
src/types.ts Extends OjectType union with "datamatrix".
src/utils/label_designer_object_helper.ts Adds creation helper and object-picker dispatch for DataMatrix.
src/utils/canvas_utils.ts Treats DataMatrix as non-scalable and enforces even/min size similar to QR/ArUco.
src/utils/canvas_preprocess.ts Applies variable preprocessing to DataMatrix text content.
src/components/LabelDesigner.svelte Shows DataMatrix parameter panel and enables variable insertion for DataMatrix.
src/components/designer-controls/DataMatrixParamsControls.svelte Adds a simple textarea-based params control for DataMatrix text.
src/components/designer-controls/VariableInsertControl.svelte Allows inserting variables into DataMatrix content.
src/components/designer-controls/ObjectPositionControls.svelte Excludes DataMatrix from manual width/height editing (like QR).
src/components/designer-controls/ObjectPicker.svelte Adds a DataMatrix object button to the picker UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread src/components/designer-controls/ObjectPicker.svelte Outdated

@MultiMote MultiMote left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. Thanks for your contribution.

You are using bwip-js just for DataMatrix rendering. It supports a LOT of 1D/2D codes, but none of them were used and the bundle size has increased by 1 MB.

It might be better if you used more specialized libraries, such as https://github.com/damischa1/datamatrix-svg-ts

@MultiMote MultiMote force-pushed the dev branch 3 times, most recently from e5381e7 to e05c73a Compare April 21, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants