Git Product home page Git Product logo

Comments (3)

tosehee75 avatar tosehee75 commented on August 12, 2024

I have a same question..

<svg>
    <g>
        <svg></svg>
    </g>
</svg>

How can I do above where the inner svg is positioned within the parent at (x, y) and width and height?

I tried below and it does NOT work.

<svg class="label-container" [style.width.px]="width * pxPerInch" [style.height.px]="height * pxPerInch">
    <g *ngFor="let widget of widgets">
            <ngx-barcode
                         [bc-element-type]="svg"
                         [bc-format]="CODE128B"
                         [bc-width]="widget.width"
                         [bc-height]="100"
                         [bc-value]="widget.value" [bc-display-value]="true"></ngx-barcode>
     </g>
</svg>

from ngx-barcode.

mpp avatar mpp commented on August 12, 2024

Hi I need to do the same, the problem is that the component is generating a <div> with an <svg> inside.
In order to do what we need, the selector should be [ngx-barcode] (with the []) so we can use it as attribute of an <svg:g>

<svg:g ngx-barcode></svg:g>

And the template of such component should be just the <svg:g>

detailed description

I tried to fork the code and include the component in my code but I get the error message: "jsbarcode is not a function"
Do you know how can I solve it?

from ngx-barcode.

mpp avatar mpp commented on August 12, 2024

I forked this project and added a component that can be used as inside an SVG:

Please tell me if it make sense, or if there is a better way to do it.
I don't like how I did it (basically copy and paste from the original).

link to my fork

from ngx-barcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.