From 3d6a43f6eaa0dbf8bf8c82d6b9d79bbc2e61e3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niilo=20Kein=C3=A4nen?= Date: Mon, 5 Aug 2024 09:40:32 +0300 Subject: [PATCH] Tweak test --- test/index.js | 25 ++++++++++++------------- test/package-lock.json | 5 ++--- test/package.json | 3 +-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/test/index.js b/test/index.js index a88a375..3b5f916 100644 --- a/test/index.js +++ b/test/index.js @@ -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"); diff --git a/test/package-lock.json b/test/package-lock.json index 5aa2266..73c6c9f 100644 --- a/test/package-lock.json +++ b/test/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "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" @@ -39,9 +39,8 @@ }, "node_modules/@lightningchart/lcjs-headless": { "version": "2.0.0", - "resolved": "file:../lightningchart-lcjs-headless-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/@lightningchart/lcjs-headless/-/lcjs-headless-2.0.0.tgz", "integrity": "sha512-LixOUIJrl6TBS8ANkZcVSxEnbB+y6bjblG7oqTvK4tbJRoiONTQgF++2EJXTftLVuCbfCOTceXEyQBEunPP2aQ==", - "license": "MIT", "dependencies": { "@types/pngjs": "^6.0.1", "@types/sharp": "^0.31.1", diff --git a/test/package.json b/test/package.json index c4c7740..da400d6 100644 --- a/test/package.json +++ b/test/package.json @@ -1,6 +1,5 @@ { "name": "test", - "type": "module", "version": "1.0.0", "description": "", "main": "index.js", @@ -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"