Skip to content

Commit

Permalink
docs: more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tool3 committed Jun 4, 2024
1 parent 873f3af commit b6eeb4f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions branding/shellfie.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,56 @@ const colors = [
];

// generate random chart data
// const data = [];
const data = [];
const labels = ['c', 'h', 'a', 'r', 't', 's', 'c', 'i', 'i', '3.0'];
// for (let i = 0; i < 3; i++) {
// const color = colors[i];
// const value = Math.floor(Math.random() * 20);
// data.push({ value, color, label: `loading` });
// }
for (let i = 0; i < labels.length; i++) {
const color = colors[i];
const value = Math.floor(Math.random() * 20);
data.push({ value, color, label: `%${labels[i]}%` });
}

const data = [
{ label: "label", value: 1, color: "pink" },
{ label: "label", value: 2, color: "purple" },
{ label: "label", value: 1.5, color: "marine" },
{ label: "label", value: 3, color: "orange" },
{ label: "label", value: 2.5, color: "green" }
];
// const data = [
// { label: "label", value: 1, color: "pink" },
// { label: "label", value: 2, color: "purple" },
// { label: "label", value: 1.5, color: "marine" },
// { label: "label", value: 3, color: "orange" },
// { label: "label", value: 2.5, color: "green" }
// ];
const chart = new Chartscii(data, {
// height: 10
// width: 50
// width: 50,
// // padding: 2,
// barSize: 1,
padding: 1,
barSize: 1,
valueLabels: true,
colorLabels: true,
// naked: true,
// padding: 2,
// valueLabels: true,
colorLabels: true,
naked: true,
valueLabels: true,
// fill: '░',
// colorLabels: true,
// theme: 'pastel',
theme: 'nature',
// orientation: 'vertical'
});


(async () => {
try {
// const data = chart.create();
// console.log(data);
// await shellfie(data, {
// name: './chartscii_chartpoint',
// viewport: {
// width: 1024,
// height: 300
// },
// });
const data = chart.create();
console.log(data);
await shellfie(data, {
name: './chartscii_chartpoint',
name: './chartscii_test',
viewport: {
width: 1024,
width: 1000,
height: 300
},
});
Expand Down
Binary file modified shellfies/chartscii_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit b6eeb4f

Please sign in to comment.