Skip to content

Commit

Permalink
Tweak test
Browse files Browse the repository at this point in the history
  • Loading branch information
Niilo Keinänen committed Aug 5, 2024
1 parent e1f452f commit 3d6a43f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
25 changes: 12 additions & 13 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import express from "express";
import { PNG } from "pngjs";
import { lightningChart, renderToPNG } from "@lightningchart/lcjs-headless";
import { flatThemeLight } from "@lightningchart/lcjs-themes";
const express = require("express");
const { PNG } = require("pngjs");
const {
lightningChart,
renderToPNG,
} = require("@lightningchart/lcjs-headless");
const { flatThemeLight } = require("@lightningchart/lcjs-themes");
const { ColorRGBA, SolidFill } = require("@lightningchart/lcjs");

const app = express();
const port = 3000;

app.get("/", (req, res) => {
const lc = lightningChart({
// Valid until 8/6/2024
license:
"0002-n6Q3wipxRCPK7PHm1Z1p6PdhNNqeKwClN/s+aUwl3vT54A0lse0e9Ryv9JY4YzR8avVBVjTpcgbR7Q8DS2egZAHn-MEUCIQC87Etz4Jn4NLyctnrTCjVOHKsy7VSxa99DG6arbb1RfgIgZKtGhZpmATUsBZ6fkq834+Sq137gFyv7lsz3OVndGvA=",
licenseInformation: {
appTitle: "LightningChart JS Trial",
company: "LightningChart Ltd.",
},
});
const lc = lightningChart({});
const chart = lc.ChartXY({ theme: flatThemeLight });
chart.setSeriesBackgroundFillStyle(
new SolidFill({ color: ColorRGBA(255, 0, 0) })
);
const chartOutput = renderToPNG(chart, 800, 640);
const outputBuff = PNG.sync.write(chartOutput);
res.setHeader("Content-Type", "image/png");
Expand Down
5 changes: 2 additions & 3 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "test",
"type": "module",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand All @@ -11,7 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@lightningchart/lcjs-headless": "file:../lightningchart-lcjs-headless-2.0.0.tgz",
"@lightningchart/lcjs-headless": "^2.0.0",
"@lightningchart/lcjs-themes": "^4.0.2",
"express": "^4.19.2",
"pngjs": "^7.0.0"
Expand Down

0 comments on commit 3d6a43f

Please sign in to comment.