Page 1 of 1

id/menu item naming in Chart Compiler

Posted: Tue 09 Jan 2024 4:13 pm
by packman2008
I'm starting to experiment with the Chart Compiler and it's a very clever bit of code :-)

One difference between a compiled drop down menu and and the default CU menus seems to be that the chart id is used for the menu name. The id doesn't seem to allow spaces in it, or at least the compile fails if I include a space. So where a default drop down menu can have an item "Space Here" with a compiled chart you could only call it "SpaceHere". If I'm wrong about this then can you please suggest what I'm doing wrong?

If it's correct that an id can't have a space in it, then would it be possible to make a change to the code to allow conversion of another character found in an id into a space, e.g. if the underscore character was the character to be converted an id of "Extra_Space" would be added to the menu as "Extra Space"?

Re: id/menu item naming in Chart Compiler

Posted: Tue 09 Jan 2024 7:39 pm
by HansR
Hi Chris,
packman2008 wrote: Tue 09 Jan 2024 4:13 pm I'm starting to experiment with the Chart Compiler and it's a very clever bit of code
Thanks! :D

About the spaced chart id: Barry (@nossis) made the same remark to which I replied:
As you will have noticed: the space is the separator character in the CDL definition. That makes it tricky - not impossible - to use a space in those labels. I understand the n eed for that space in the labels though. I'll put it on the ToDo list (low). NOTE: it may be impossible because of javascript variable limitations but I have to look into that.
I haven't looked into that any further at the moment, so that is where it is: on the ToDo list.

I will take the idea of e.g. an underscore to convert to a space for the menu text with me as a possibility for the texts which are visual to the users. But again: no promise yet ;)

Re: id/menu item naming in Chart Compiler

Posted: Tue 09 Jan 2024 8:06 pm
by packman2008
Barry (@nossis) made the same remark to which I replied:
I tried looking for the answer first but didn't find that comment. I'm still very much learning CMX, CU and CC so part of asking is just in case I've missed something. None of my suggestions are essential or urgent...I have plenty to experiment and tinker with at the moment!

Re: id/menu item naming in Chart Compiler

Posted: Wed 10 Jan 2024 3:29 pm
by mcrossley
Can you enable "useHTML" in the title and then use a name like "Something Spaced" or "Something Spaced"?

No idea how CUtils would cope with that though!

Re: id/menu item naming in Chart Compiler

Posted: Wed 10 Jan 2024 4:42 pm
by packman2008
I just did a quick test.

The good news is that CUtils happily added the string containing   to the .txt file, and the menu entry had a space where it didn't before.

The bad news is that the   seems to have messed up a lot of stuff generated by CUtils below the point where it was included in the .def file, i.e. none of the graphs were generated.

Re: id/menu item naming in Chart Compiler

Posted: Wed 10 Jan 2024 4:47 pm
by HansR
mcrossley wrote: Wed 10 Jan 2024 3:29 pm Can you enable "useHTML" in the title and then use a name like "Something Spaced" or "Something Spaced"?

No idea how CUtils would cope with that though!
You mean something like this:

Code: Select all

title: {
    useHTML: true,
    text: "<p>Some text with spaces</p>",
  },
Maybe possible, maybe I solve it another way.
Anyway, first step would be to have the parser of the ChartsCompiler accept the space which - as I said above - is not accepted in my definition language as a character so that for a start requires some thinking.
packman2008 wrote: Wed 10 Jan 2024 4:42 pm The good news is that CUtils happily added the string containing &nbsp; to the .txt file, and the menu entry had a space where it didn't before.

The bad news is that the &nbsp; seems to have messed up a lot of stuff generated by CUtils below the point where it was included in the .def file, i.e. none of the graphs were generated.
The last part was what I more or less predicted. Nice experiment though.

In summary: I don't think users can solve this.