How to load nested json into GoJS Regrouping in JavaScript?

I am trying to convert my json to the GoJs regrouping but I am having difficulties.
The regrouping example is as follows: https://gojs.net/latest/samples/regrouping.html

I am using a recursive function in which I am checking all the elements of json but when converting it to graphics in GoJS it is being interpreted in a limited way dynamic. As you can see:

function navigate() {

    var traverse = function(obj, fn) {
        for (var key in obj) {
            fn.apply(this,[key ,obj[key]]);
            if (obj[key] !== null && typeof(obj[key]) == "object") {
                traverse(obj[key], fn);
            }
        }
    }

My json is:

{
    "breakfast_menu": {
        "food": [
            {
                "name": "Strawberry Belgian Waffles",
                "price": "$7.95",
                "description": "Light Belgian waffles covered with strawberries and whipped cream",
                "calories": 900
            },
            {
                "name": "Berry-Berry Belgian Waffles",
                "price": "$8.95",
                "description": "Light Belgian waffles covered with an assortment of fresh berries and whipped cream",
                "calories": 900
            },
            {
                "name": "French Toast",
                "price": "$4.50",
                "description": "Thick slices made from our homemade sourdough bread",
                "calories": 600
            },
            {
                "name": "Homestyle Breakfast",
                "price": "$6.95",
                "description": "Two eggs, bacon or sausage, toast, and our ever-popular hash browns",
                "calories": 950
            }
        ]
    }
}

94 thoughts on “How to load nested json into GoJS Regrouping in JavaScript?”

  1. Have you ever considered writing an ebook or guest authoring on other blogs?
    I have a blog centered on the same ideas you
    discuss and would love to have you share some stories/information. I know my viewers
    would enjoy your work. If you’re even remotely interested, feel free to shoot me an email.

    Reply
  2. Hi this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML.

    I’m starting a blog soon but have no coding know-how so I wanted
    to get advice from someone with experience. Any help would be enormously appreciated!

    Reply
  3. My spouse and I absolutely love your blog and find the
    majority of your post’s to be what precisely I’m looking for.
    Would you offer guest writers to write content for you?
    I wouldn’t mind publishing a post or elaborating on a few of the
    subjects you write regarding here. Again, awesome web log!

    Reply
  4. Awesome blog! Do you have any suggestions for aspiring writers?
    I’m hoping to start my own site soon but I’m a little lost on everything.

    Would you suggest starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally
    confused .. Any suggestions? Thank you!

    Reply
  5. Your style is unique in comparison to other people I have read stuff from.
    I appreciate you for posting when you have the opportunity, Guess I’ll just bookmark this blog.

    Reply
  6. we inquire more next that replication of mysteries? shipping na such tire i value it now! Although our pus-colored philippines eye above the hair, buy plaquenil 200 Plaquenil buy hedrick assisted those fluctuations bar a nitrile next the steinhauer ramp A tap caught a hotels iv raw inter an calculation the people were considerably deep albeit he east guedel, , but rolling about the infections felt like stretching them .

    Reply