I'm trying to analyse how the ESP-Dash-library works. Gipo of ESP-Dash
It makes heave use of Arduino-JSON.
I'm a bit unsecure if this user-forum is the best place to ask Arduino-JSON-questions
or maybe looking for a JSON-userforum in general (not an Arduino-JSON-specific forum)
I estimate that JSON is the same as Arduino-JSON. Maybe some special functions left out for RAM-saving reasons.
So does anybody know of a user-forum where some users are JSON-specialists?
If they are right here at Arduino-cc even better.
Benoît Blanchon wrote the Arduino-JSON library and he has extensive documentation(and examples, videos) on line
All bugs, features, and discussions about ArduinoJson are in the GitHub issues but I think your question regarding ESP-Dash will not really be ArduinoJson related but understanding how to add an index into the JSON description
You will need to add a _card_index variable in the Card Class instance variables, modify the constructor to be able to define the index (or a grid position)
Then you will need to include this cardIndex into the JSON that is built for that card. it will likely happen in the generateComponentJSON() of the ESPDash Class and modify
to add doc["card_index"] = card->_card_index;within the if()
(you have this method twice, once for cards, once for charts)
If I'm right, that's the "easy part", you'll now have the right card_index attribute in the JSON list that is sent to the browser.
Then the magic of the layout happens in the huge gzipped painful to read javascript that is sent to the client. You'll have to unzip the code (as discussed in the other thread), find the needle in the haystack of which functions are in charge of the layout (probably reading the JSON) and modify that JS function to read according to the card_index attribute, then gzip the file again, dump its ascii value representation and put that back into the const uint8_t DASH_HTML[] PROGMEM array