cmudig/apigen

Up-to-date Summary

lan-lyu opened this issue · 1 comments

What has been achieved

In short, the code now takes vega-lite types and generates a folder of vega-lite-api-like code. The input is vega-lite/src/spec/index.ts. The output is a folder including each file as a typescript class to support usage in the api such as VL.data("example.csv").autosize("fit").

generated
├── __util__.ts
├── autosize.ts
├── concat.ts
├── ...
├── topojson.ts
├── urlData.ts
└── vconcat.ts

An example of what generated classes are and how they are used can be checked here.

How it is achieved

  • parse from vega-lite/src/spec/index.ts and get types info using type checker (code)
  • convert information in internal representation to support multi-language generation (code)
  • generate classes from pre-defined api const (same logic as vega-lite-api) (code)

What's left

Code cleaning

  • clean the code
  • add comment on each function
  • add links to corresponding functions on How it is achieved part above
  • clean the branches, leave the main ones, and update the history of explorations accordingly
  • brief introduction about repos' code structure to help others get started

Function-wise

  • add all api specification so that we generate all classes needed
  • documentation generation feature
  • support python generation

Some essential repos to get started

vega-lite types

vega-lite-api

json-schema generator

History of explorations

Great start. Can you be more specific in how this code works and what you imagine would be done in clean the code?