I had an idea of generating flow charts from openai response in markdown values, and then render them using mermaid js library.
This way a chatbot can be made which generates multiple plots.
I had an idea of generating flow charts from openai response in markdown values, and then render them using mermaid js library.
This way a chatbot can be made which generates multiple plots.
yes good idea. Here is my example:
Flow Chart Generator<script>
document.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
// Wait for Mermaid to load
window.addEventListener('load', () => {
console.log('Window fully loaded');
try {
mermaid.initialize({ startOnLoad: false });
console.log('Mermaid initialized');
const mermaidSyntax = `
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server01]
B --> D[Server02]
`;
const element = document.querySelector("#flowchart");
mermaid.render('mermaid-diagram', mermaidSyntax).then(result => {
element.innerHTML = result.svg;
console.log('Mermaid render completed');
});
} catch (error) {
console.error('Error:', error);
}
});
});
</script>

These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.