Skip to main content
Solved

Custom Shapes - JSON


Forum|alt.badge.img+3

Hi,

I’m using JSON to create Custom Shape. I have two questions to go further :

1 . Is it possible to identify to which shape a line is connected when using a Custom Shape? For example, using the formula (=DOWNSTREAM), I can see all the shapes in my Custom Shape. However, I don’t know how to identify the element directly connected to my line.

 

  1. Is it possible to take a value from the parent document and use it in a Custom Shape? When I try to use a formula in a Custom Shape, it is processed as a string. I have tried various ways to makes it work, like the example below.

 

Thanks for your help,

NM

Best answer by Nathan Kim

Hi NM,

`test-shape-libraries` is working once again!
To use it, run `npx lucid-package@latest test-shape-libraries` just like you mentioned before, and when you’re prompted, install the latest version of `lucid-package`. Also, make sure that in the Lucid editor, you have the setting “Developer > Load Local Extension” selected.

Then, in the editor, your custom shapes should be automatically loaded as a shape library, like your bundled version. (The plaintext output that you mentioned will be automatically fetched by the editor.)

(If you’d like, this link has some extra documentation.)

Hope this works for you! If not, let us know and we’re happy to help -- there may be some other needed steps.
-Nathan

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+2

Hi NMN! Thanks for the question. 

 

To the answer the first question, if 12, and 3 are all all sub-shapes in the custom shape, it isn’t possible currently to identify which shape the line is connected to as it is not a separate shape, but rather a part of the shape. Splitting them into separate custom shapes would make that possible and you could group them into a shape that is dragged into the shape library to make it easier to use.

 

For the second question, strings in textareas always use interpolation when processed. In order to support your case you would need to use something like {{=parent.out1}} in place of just the standard text. I believe this works in HJSON, but it may need to be wrapped in a string. 

 

Please let me know if that works for you and if you have any other questions. Thanks!


Forum|alt.badge.img+3
  • March 17, 2025

Hi Thanks for your answer !

Oh, it's so sad that it's impossible to identify sub-shapes. The point was to create a dynamic shape to add or remove rows, like in the multiplexer example. I’m currently using a group of shapes for that purpose, but it's very tedious to always manually add or remove shapes to adapt the content.

 

For the second answer, it works great ! Thanks

 

 

I have an other question. Is there a way to quickly visualy check and debug a custom shape ? Currently I’m using :

npx lucid-package bundle

and then manually import to the library.

 

I’ve tried

npx lucid-package@latest test-shape-libraries

But the output is in plain text

Thanks again for your help !


Nathan Kim
Forum|alt.badge.img+2
  • Lucid product team
  • March 18, 2025

Hello NMN!

Using `test-shape-libraries` is unfortunately currently broken. Sorry about this. (But, yes, that would be the way to quickly debug custom shapes.)
In the meantime, what you’re currently doing (through `bundle`) is the workaround we recommend.

If you have any other questions, Chase and I are happy to help!


Forum|alt.badge.img+3
  • March 19, 2025

Thanks for your answer. Is there a way to install a previous version where the  `test-shape-libraries`  was working ? It’s a bit tedious to go back and force with the export / import functions

NM


Nathan Kim
Forum|alt.badge.img+2
  • Lucid product team
  • March 19, 2025

Hi NM,

Unfortunately, there is no way to install a previous version with `test-shape-libraries` working. Sorry for the inconvenience.
However, I’ve passed along your idea, to my product team. If a fix is released, we’ll let you know.


I hope to get back to you soon!


Nathan Kim
Forum|alt.badge.img+2
  • Lucid product team
  • March 27, 2025

Hi NM,

`test-shape-libraries` is working once again!
To use it, run `npx lucid-package@latest test-shape-libraries` just like you mentioned before, and when you’re prompted, install the latest version of `lucid-package`. Also, make sure that in the Lucid editor, you have the setting “Developer > Load Local Extension” selected.

Then, in the editor, your custom shapes should be automatically loaded as a shape library, like your bundled version. (The plaintext output that you mentioned will be automatically fetched by the editor.)

(If you’d like, this link has some extra documentation.)

Hope this works for you! If not, let us know and we’re happy to help -- there may be some other needed steps.
-Nathan


Forum|alt.badge.img+3
  • March 27, 2025

Hi Nathan,

Wow, it’s a game changer for creating and debugging custom shapes!

Thanks to the team who worked on the fix. 👍🏻

Nicolas

 


Reply