How can I determine the data structure of a built in data set in a plot?

I would love to make quick work from Plots such as this hierarchical tree:

Plot.plot({
axis: null,
margin: 20,
marginRight: 120,
marks: [
Plot.tree(flare.slice(0, 50), {path: “name”, delimiter: “.”})
]
})

The data is, I gather, flare. If I want to use my own data instead, I will need the same data structure/format. I imagine that this should be easy, but as far as I understand it I will need to find and dig into the structure of flare first. Is this correct?

If you are using observable notebooks or framework, you can just type flare in a cell or a code block, and you will see the inspector:

Elsewhere you can use console.log(flare) to display it. The crucial thing to understand is that when in Plot you say path: "name", the path channel will be constructed by taking the name property of each element of the data (that is, flare.slice(0, 50) in this case).

If you want to adapt this code to your data (rather than adapt your data to this code), you can use a different property name, or even a function, to populate the path channel. See Marks | Observable Plot for details.

The delimiter option tells Plot what character to use when it splits the path channel into a hierarchical structure.

Super helpful. Thank you. An you’re right about adapting code to my data. That seems like a better approach.