Published
Edited
Sep 20, 2022
3 stars
Insert cell
# Comics and Coding
Data Visualisation is more about inspiration than problem solving. Let me tell you why?
I was looking for some new ways to create a portfolio website that includes my findings and blogs. During that search, I [comicgen](https://questionsindataviz.com/2022/03/05/how-can-we-use-comics-to-tell-data-stories/) through a review by Neil Richards. The idea of drawing comics through code got me thinking.
Below is a small foray into world of "requires" to get the Comicgen api to work in Observable. Went searching for Inspiration, ended up with problem.. An interesting one in that.
Insert cell
comicy = require('comicgen@1.9.4/src/comicgen.js').catch(() => window["comicgen"])
Insert cell
Comicgen doesn't work with regular require. Using the [require debugger](https://observablehq.com/@observablehq/module-require-debugger) I could reach to the function that Comicgen API has exposed through Unpkg. Then I got stuck there itself.
Insert cell
After some more poking around the [comicgen](https://gramener.com/comicgen/) website I found that library source link used "https://gramener.com" as the base. I copied that and tried requiring that in observable.
Insert cell
gramener = require('https://gramener.com/comicgen/dist/comicgen.min.js')
Insert cell
gramener.namemap
Insert cell
gramener.version
Insert cell
gramener.base
Insert cell
gramener.formats
Insert cell
Insert cell
Insert cell
html`<g class="new" name="dee" angle="straight" emotion="happy" pose="yuhoo"></g>`
Insert cell
Insert cell
html`<g class="new1" name="ringo" angle="straight" emotion="happy" pose="yuhoo"></g>`
Insert cell
gramener('.new')
Insert cell
gramener('.new1')
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more