Skip to content

Instantly share code, notes, and snippets.

@C451
Last active May 20, 2023 17:47
Show Gist options
  • Save C451/362210179fd1c452b4907a8f3e04a252 to your computer and use it in GitHub Desktop.
Save C451/362210179fd1c452b4907a8f3e04a252 to your computer and use it in GitHub Desktop.
Converting TVJS overlay to NavyJs with ChatGPT-4 (approx). Prompt Template.
I need to convert trading-vue-js overlay to my new .navy language. Let me show how it should look:
```navyjs
// Navy ~ 0.1-lite
// <ds>Description</ds>
[OVERLAY name=OverlayName, ctx=Canvas, verion=1.0.0, author=GPT4]
// Define new props (types: number, string, boolean, object ...), e.g.:
prop('color', { type: 'color', def: '#31ce31' })
// Local Variables (those defined in data() function), e.g.:
let A = null
// Draw function
draw(ctx) {
// this.$props.layout => $core.layout
// this.$props.data => $core.dataSubset
// t2screen => time2x(t)
// $2screen => value2y($)
// Access props: $props.color
}
// mouseup, keydown, keypress, etc.
mousedown(event) { }
// Returns array of [value, color] pairs
legend() => []
```
The overlay i need to port:
```tvjs
<Your TVJS overlay>
```
All computed stuff should be converted to props. Ignore `use_for` and `calc`. `sett` is a reference to props object, ignore it too. It's a hypothetical script, but try to implement all methods. Please don't explain, focus on code.
@C451
Copy link
Author

C451 commented May 17, 2023

Write 'Continue' if there is not enough context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment