bartbutenaers / node-red-contrib-ui-svg

A Node-RED widget node to show interactive SVG (vector graphics) in the dashboard
Apache License 2.0
93 stars 27 forks source link

text update not work for me #53

Closed d0d04m3 closed 4 years ago

d0d04m3 commented 4 years ago

hi please help me i design dashboard with svg editor hmi2 but i cant updated or changed any text with both way exp: { "command": "update_text", "selector": "#e1_texte", "textContent": "test" } and with inject msg {"title": "text "} with input bind same not working and if changed any attrinute exp fill or visibility its worked and if use another svg with one text or tow its worked what probleme this lib its limited for line code or not support more texte !!!!

bartbutenaers commented 4 years ago

Hi, Can you please pass me a "simplified" flow (e.g. containing a single switch) so I can try to reproduce your problem).

what probleme this lib its limited for line code or not support more texte !!!!

Can you explain that a bit more. Not sure what you mean by that sentence. Bart

d0d04m3 commented 4 years ago

ok man i detect the probleme its red line when removed its work !

bartbutenaers commented 4 years ago

Hi @d0d04m3, Thanks for digging into it yourself!

Although your problem is solved, could you provide me some extra information:

  1. Which element id was causing the problem? Because the SVG is very large to find it manually ...
  2. Do you know what the problem was with that particular line?

I saw this error when I loaded your SVG:

image

And I have to avoid that a simple SVG error causes the entire message handling to fail. Would like to create a bugfix in the near future, to avoid that other users run into the same problem as you...

Thanks!

d0d04m3 commented 4 years ago

sow this what happened i remove all text id -> same problem i remove all icon -> sam problem i remove all line -> its work so i reset all text id + icon except line its work when add first lin -> work secondary line -> work hmi3

last line -> not work hmi4

remove last line added its work ! so am add this last line again its work !!! this my flow i hope worked for you flows (1).zip

d0d04m3 commented 4 years ago

Hi @d0d04m3, Thanks for digging into it yourself!

Although your problem is solved, could you provide me some extra information:

  1. Which element id was causing the problem? Because the SVG is very large to find it manually ...
  2. Do you know what the problem was with that particular line?

I saw this error when I loaded your SVG:

image

And I have to avoid that a simple SVG error causes the entire message handling to fail. Would like to create a bugfix in the near future, to avoid that other users run into the same problem as you...

Thanks!

where this error.....i cant show any error this for chorme console or debugger ?

d0d04m3 commented 4 years ago

so i fineshed all itemes and line and no probleme I Understand why some times not works yesterday same probleme and deleted all my project and work again from zero and today same thing happend

bartbutenaers commented 4 years ago

Wow, nice feedback! Yes you can find the error in the console log of Chrome (via menu : developer tools). You can you please share your SVG (i.e. the one which works fine) again. Then I try to compare whether I can see something different ... It is very annoying for users if they have to start with their drawing over all again ;-(

bartbutenaers commented 4 years ago

Hi @d0d04m3, What a work ... I have narrowed down the problem to this small snippet:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" height="100%" viewBox="-0.1964024156332016 -0.0687660425901413 1000.392822265625 350.1374816894531" width="100%" preserveAspectRatio="xMidYMid meet">
  <defs id="svgEditorDefs">
    <marker id="arrow10-8-right" markerHeight="8" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="-3" refY="0" viewBox="-15 -5 20 20">
      <path d="M -15 -5 L 0 0 L -15 5 z" fill="black"/>
    </marker>
  </defs>
  <g id="g_e1_svg" style="">
    <line id="e1_line" x1="831.3800242832729" y1="311.218994140625" x2="831.3800853184291" y2="326.8453369140625" style="stroke: red; fill: none; stroke-width: 2.97px; marker-mid: url(&quot;#arrow10-8-left&quot;);"/>
  </g>
</svg>

The problem is that your SVG contains a lot of &quot; strings. When I remove those, the errors don't appear anymore in the console log. So that is the way you should solve it ...

BTW. How did you create your SVG?

Will ask in your issue on Discourse whether someone knows how I could get rid of those &quot; strings in the future.

d0d04m3 commented 4 years ago

yes its error in console i dont any id for this am send you to flow one worked another not worked.zip not worked.zip

bartbutenaers commented 4 years ago

Is your problem not solved by removing all the &quot; occurences in your SVG string?

d0d04m3 commented 4 years ago

The problem is that your SVG contains a lot of &quot; strings. When I remove those, the errors don't appear anymore in the console log. So that is the way you should solve it ...

BTW. How did you create your SVG?

Will ask in your issue on Discourse whether someone knows how I could get rid of those &quot; strings in the future.

am use integreted tool its svg editor and when find quot in tow file : worked flow -> 0 found not worked flow -> 34 found and removed all so error it going and flow worked 100% very thanks to solved am now sur probleme for bad connection am use online tools for svg editor

bartbutenaers commented 4 years ago

Ok, thanks. As soon as I have time, I will contact the author of the DrawSvg editor to see whether we can solve this issue in the future. Have fun with your drawing!!

d0d04m3 commented 4 years ago

Ok, thanks. As soon as I have time, I will contact the author of the DrawSvg editor to see whether we can solve this issue in the future. Have fun with your drawing!!

best regard man now am not worry fro next work

bartbutenaers commented 4 years ago

Had forgotten that this issue was solved (as discussed on the Node-RED forum).