Skip to content

ZIM 020

Latest

Choose a tag to compare

@danzen danzen released this 09 Aug 17:50
· 16 commits to master since this release

ZIM is a general canvas framework at https://zimjs.com - official updates are at https://zimjs.com/updates.html

Welcome to ZIM 020!

1. CHART MODULE

https://zimjs.com/020.html
Added the ZIM Chart helper module (like Sockets, Game, Three, Physics, Pizzazz, Cam)
Must import https://zimjs.org/cdn/020/zim_chart

bargraph
// must import zim_chart
const graph = new zim.BarGraph({
	title:"Sales of Vegetables",
	width: 700,
	// comment these out to see with light background
	backgroundColor: black,
	axisColor: light,
	gridColor: grey,
	color: lighter,
	dataColor: silver,
	// end of comment for light background
	info: {
		labelH: "Days",
		labelV: "Sales",
		dataH: {start: 1, end: 7, step: 1},
		dataV: {start: 0, end: 100, step: 10}
	},
	colors: series(purple, yellow, blue),
	data: [
		{item: "Cucumber", icon: null, dataH: [2, 3, 4, 5, 6], dataV: [10, 40, 50, 60, 20]},
		{item: "Lettuce", icon: null, dataH: [2, 3, 4, 5, 6], dataV: [70, 50, 20, 20, 40]},
		{item: "Cilantro", icon: null, dataH: [2, 3, 4, 5, 6], dataV: [20, 50, 80, 90, 50]},
	],
	// gradients:false
});

// optionally put graph in Panel
STYLE = {infoicon: {size: 12, color: white}, onTop: false, collapse: true, titleBar: "Bar Graph", draggable: true};
new Panel(graph.width, graph.height + 30, graph).center();

// optionally put legend in Panel
const legend = new zim.Legend(graph);
STYLE = {infoicon: {size: 12, color: white}, collapse: true, titleBar: "Legend", draggable: true};
new Panel(legend.width + 20, legend.height + 30, legend).pos(60, 50, RIGHT, BOTTOM);
STYLE = {};

There are other charts too - see the example links.

Two slightly different Charts are Word Cloud and Championship as follows.

wordcloud

https://zimjs.com/020/wordcloud.html
http://im.sheridanc.on.ca/promo/book.html (in ZIM Book)

// WordCloud

// we can use WordCloud on raw text - but that takes extra processing
// here are the steps to have WordCloud process and save a data list

// we copied the text from the ZIM Innovation page, 
// saved it as a long string `` in a const words and passed that into WordCloud
// we ran the WordCloud and noticed words we did not want 
// so we manually created this exclude array:
// const exclude = ["complex", "decade", "through", "last", "fully", "63", "allows", "set", "made", "friction", "other", "single", "zims", "still", "every"];
// then we added this coding line 
// zog(JSON.stringify(cloud.prepareWordData(words, 50, 1, exclude)))
// this we stored in this const words instead of the raw text
// a shortened version is shown here

const words = [
	{"text": "Zim", "freq": 100}, 
	{"text": "Canvas", "freq": 44}, 
	// etc., 
	{"text": "Creating", "freq": 6}
];

// words, width, height, scaleFix, font, color, backgroundColor, spacing, verticalMix, uppercase, minSize, maxSize, style, group, inherit
var cloud = new zim.WordCloud({
	width:700,
	words: words			
}).center();

// optionally animate the words in
cloud.animate({
	props: {alpha: 0},
	from: true,
	time: .3,
	sequence: 0.02
});
championship
// must import zim_chart
new Championship({
    title:"Championship!", 
    data:[[],[],[],[],["Best"]], 
    padding:30, 
    align:CENTER, 
    lastScale:1
}).center();

See formatted championships at:

2. AI MASTER PROMPT

https://zimjs.com/prompt.html
Dr Abstract spent a couple weeks building an AI Master Prompt.
This was done working with Claude 4.7 but can be adapted to any model.

PROMPT SECTIONS

  • PREPARATION - leave as-is
  • TASK - replace placeholder task
  • CONTEXT - leave as-is
  • CONVENTIONS - evolve over time
  • REASONING - adjust or remove
  • STOP CONDITIONS - adjust or remove
  • OUTPUT - leave as-is

3. BULLETS

https://zimjs.com/020/bullets.html
Makes traditional bullet list like html ol, ul, li tags.
Can use pizzazz icons and also do nested bullets (see Docs)

new Bullets(["First item", "Second item", "Third item"]).center();

// or for numbers

new Bullets(["First item", "Second item", "Third item"], "numbers").center();
image

4. GESTURE TRACKPAD SUPPORT

Added laptop trackpad support for ZIM gesture()
Pinch to zoom, swipe two fingers horizontally (same direction) to rotate
objects that have gesture() added. Code assistance from AI Claude 5.
noGesture() removes the events.
Thanks Karel Rosseel for the suggestion.

5. GENERAL

Added onTop parameter to Panel and NumPad default true
Added valueLite to Stepper - should just make stepper not update the stage if setting a value
was resetting 60 steppers and that is 60 stage updates - bogs mobile.
rewindPick in animate moved from end of parameters to after rewindEase

6. SITE UPDATE

Updated front banner with animated Z and simplified side links
The Dr Abstract icon has moved down to a new Dr Abstract and Pragma promo panel
The site now is generally on a light background rather than a dark background
The order of the sections on the front page have been rearranged but generally unchanged
The About, Examples, Learn, and Code secondary pages have been changed.
About, Learn and Code are simplified for promotional impact.
Each page has an ARC link at the bottom to the old full pages with many icons.
The Learn page has been divided into Beginner, Intermediate, Advanced, and Articles

image