HNHacker News
TopNewBestAskShowJobs

chenglong-hn

313 karma · joined October 21, 2024

submissionscomments
chenglong-hn··on Creating interactive data visualization with Flint-interactive
Since we last built Flint earlier this year (https://news.ycombinator.com/item?id=48834924), we have been wondering if interactive charts can also find they home in terms of simple high-level specifications to allow AI agents to produce them easily, reliably and with high-quality. I have always been amazed by NYT interactive stories back in school, as they can always tell a fun story without super long verbose text write-ups; thus I have been wondering what if they can just be as easily created as any basic charts to make them easier to create everywhere. Despite the AI models now are more capable of creating interactive artifacts, we find creating interactive charts still kinda annoying (esp. if you are building them to serve users directly in their chat, in your data apps). Agents (especially with smaller models) quite often generate interactions with undesired effects, they are often quite slow, costly, and extremely annoying if to want to steer it to change something. Most times, I find that if I ask the agent to change interaction, it can randomly change style, layout, even the data.

We find the issue is that the language agents use to create interactive visualization is kinda low-level. The logic for specifying data encoding, style and interactions are all entangled (if you swap x,y axis, you are likely going to redo your interaction and layout again). Thus, despite agents have been working hard, it is essentially doing lots of stuff bottom up. We decide to design a language that can separate the visual logic and the interaction logic to make specification much cleaner, manageable, and friendly (to both human and AI). The magic here is that we are now disentangle the logic at the spec level, but make the compiler to do the heavy lifting (sorry, compiler!) to wire up logics to support easy composition and adaptation of the logics to create a expressive interactive charts. We used a trick of bidirectional transformation to help the compiler maintain the mapping between pixel/visual space to data semantics so the specs can stay at a higher-level. We made a video to explain the ideas.

https://youtu.be/JAJy7ToczMs

Some principles we had in the design:

- the language should be high-level and the agents can easily user them in chats/apps declaratively (with many presets).

- the language should not give up expressiveness. We also provide a programming API, so that you can use it to create charts in your app/dashboards for external interactions. The expressive API also makes it possible to compose very cool bespoke interactions (the spinning globe in the website).

To try it out:

- You can try Flint in your agent app. Simply call your agent to create it as an MCP app in your chat! (https://microsoft.github.io/flint-chart/#/mcp)

- If you are building applications, ask the agent to use the library. Flint is especially suitable for building agentic apps where you want agents to bring up an interactive charts quickly in the user session following their asks.

- Btw, the flint mcp app allows you create interactive dashboard in the chat as well.

Finally, I'm thinking that despite AI agents are now so good at coding, that they seem to be able to create EVERYTHING. It might not just be the time to give up designing new languages to make it easy to describe and create stuff. In the end, language is still the way for us to communicate with the computer, I think the alignment of programming language between human and AI in could probably make building, steering easier.

chenglong-hn··on Show HN: Flint-interactive, a language for interactive data visualizations (MSR)
We have plenty demos of the interactions here! - https://microsoft.github.io/flint-chart/#/interactions/advan...
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
no yet! that's a good direction!
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Mostly for expressiveness and reliability & cost trade-off. Flint has advantage of being an intermediate language that allow agents to generate good-looking stuff without additional refinement loops, since the compiler derives lower-level geometric constraints from semantic types.

Would especially be handy when we are building some agents that produce charts that serve end users (they want faster and more reliable experiences!).

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Both, it's a combination of latency / reliability / expressivenss. I think when models are more powerful, we will also more naturally want to create more expressive stuff.
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
This is awesome!
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
We struggled the same, especially when deploying an agent to end users, they are even more frustrated with any mistakes from agents than us!
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
This is a formal language that compiler can take! The natural language and clarify loop helps the LLM to generate Flint spec that can render.
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
We made an intentional decision to make it non-compositional for now, and we are using chart-type based approach to handle more expressive charts. (e.g., CDF charts)

But! We have a new project coming in to work on annotation machanism and interactivity to make it supporting presentation tasks.

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Thanks a lot for the suggestion, I do think we will need to work on accessibility support in Flint, this is a perfect place to centrally handle accessibility issues.

I added an issue to track this

https://github.com/microsoft/flint-chart/issues/48

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
We will link it on github and the project page!

https://github.com/microsoft/flint-chart

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
We find an additional dimension where previous language doesn't explicitly use (semantic type) as the key part of the specification, which turned out to be the root reason of why certain low-level parameters are set.

Effectively Flint is designed to specify charts using another set of semantic parameters over geometric parameters, which happens to be something AI are pretty good at! (They can based on field names + sample values to infer the semantic types reliably than guessing geometrical params.

Btw, for others reading this comment, this is the XKCD we are talking about! https://xkcd.com/927/

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
That's the best option for now. But it can also be frustrating to ask AI to do small edits on D3 just to fix some idioms (like switching order etc) and they kept messing up with other stuff accidentally. Thus I still believe have a language with native representation for these diagram concepts would be helpful.

Good news is that AI do make new language a bit more accessible than before! If your agents can use it well and you can steer easily, it will naturally be good adoption.

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
I find it lacks some easy way to do alignments or grouping, which makes editing frustrating. Could be a good language re-design opportunity.
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
great point, I feel both the low-level foundation language and the high-level abstraction should evolve together, just like how human programming language evolves (e.g., frontend frameworks and libraries).
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Yes! correctness, expressiveness, reliability and cost (token + time)
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
the design here has some constructs (i.e., semantic types) that AI can use better than human at generation time; and then the generated spec can be easy for user to edit since there is no need for hard-coded low-level parameters!
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Also guidelines sent to the agent may or may not get ignored if they are just part of the context :(
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
more like, instead of watching the AI agent 20 minutes to create a polished chart with 100k tokens, Flint lets you get there in 20 second with 200 tokens with a 95% polished chart. :)
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
It's often comes with missing keys, use wrong value type (e.g., list over dictionaries). Mostly a small model issue and open source models, they don't follow instructions on the structure guidance that well, and there is no easy way to do generation-time validation.
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
You are absolutely right. But note that we are actually on the same point here.

This is exactly why this is an intermediate language designed to get 95% stuff right easily (for expressiveness and reliability purpose), while 5% of more advanced case where the agents need to revise chart for other purpose can be done easily on top of the compiled low-level spec (low in terms of Vega-Lite etc, not SVG). We are not really designing a higher abstraction to replace existing ones.

In the past, the split is like 50% good at first run for some common stuff, all other stuff requires agent-loop or user involvement.

Our goal is to make it easy for most case, not everything needs a full multi-round trip agentic workflow to solve. :)

We are kinda all advanced users in fact, for a lot of users, they are easily get confused with the first time result if that is not as good, and the interactivity cost / multi-round isn't an option.

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
A little bit more than that! Here shows why a higher-level abstraction can be helpful for chart generation: https://github.com/microsoft/flint-chart#features
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
It's a white box! We built a demo here: https://microsoft.github.io/flint-chart/#/documentation/char...

We use a fun elastic algorithm to decide dimension etc within the developer's constraint.

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
also user interaction afterwards -- if can be frustrating if the only way the user can interact with the chart is to chat with the agent again (simple spec allows easy UI interaction!)
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
JSON schema can do it to some degree, I think?
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Seems a bit more like https://mermaid.js.org use cases!
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
I felt conflicted as well, json is portable and easy to parse / validate and edit. But many models do still struggle. There are some stuff from functional programming might be worth bringing back here.
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
https://microsoft.github.io/flint-chart/#/

The "how it works" section explains a little bit of this. For example, for the heatmap example showing temporal data, for a "good-looking" chart, we need to (1) reconcile the conflict between banded discrete steps and continuous temporal axis, and it requires understanding and setting stepsize and time parser, (2) for the correlation color, we need to set domain etc under the color axis.

These are supposed to be handled automatically as system defaults, but the tricky part is that these decisions are "semantical", thus requires us to understand the data and design principles, thus existing languages won't stretch that far. And the actual good looking spec is actually over 40 lines of json spec with many low-level paramters, way beyond the simple 5 line encoding promised by GoG. Flint uses semantic type and a layout optimization algorithm to handle this, so 5 lines of encoding + data semantic types can derive rest parameters automatically.

Some examples in the gallery are more extreme: like the waterfall chart example is way over 100 lines of code, and sunbusrt, rose chart are even more since compositions are quite difficult in GoG.

Glad to have a discussion on this level! In fact, we wrote a paper about this, will be putting it online in a week or so!

chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
I actually made a chart with Flint to show MSFT stock, and with sparkline chart to compare with other companies... :)
chenglong-hn··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Grammar of graphics has been the foundation of a lot of stuff and definitely worth learning for everyone!

A challenge with GoG is that it assumes configurations as second-class stuff, which makes it quite difficult for users to deal with things like changing formatter, scale, annotations. Flint kinda want to hide this aways (so Flint sets them on behalf of the agent or the user). But yeah, GoG is still the foundation for expressivenss.

Page 1 of 2Next →