komi1230 / kai Goto Github PK
View Code? Open in Web Editor NEWA high-level plotter library for Common Lisp.
Home Page: https://komi1230.github.io/kai
License: MIT License
A high-level plotter library for Common Lisp.
Home Page: https://komi1230.github.io/kai
License: MIT License
Plot files (kai.html and others) are perfectly created but a browser cannot be opened from CLI.
Instead of opening a browser, a file explorer is opened.
I think the problem is on a trivial-open-browser used package in kai.
I tried to open kai.html using a function of a trivial-open-browser and found the same bug.
trivial-open-browser uses a command of explorer for opening a file (or URL) using a UIOP.
I couldn't figure out though, a command of " explorer 'sample.html' " doesn't work on my enviroment. (a command of "explorer 'URL' " successfully works.)
So, it might be suggested to use a different package instead of a trivial-open-browser.
-Environment-
Windows 10
Run Rosewell on PowerShell
The cache directory used for plots is in the wrong location for MS Windows. On that platform, cache data is stored in the location specified by the %TEMP%
environment variable. Alternatively, if the plot specification is meant to to be written to disk and reused or copied elsewhere, it would go in the %LOCALAPPDATA%
directory.
Is there a way to insert the plot size into the generated JavaScript? Trying to open a browser with a specified size is fraught with difficulties and, even when it can be done, the user has to guess at what a good initial size might be. The methods to do this from a command line also vary across browsers.
It seems that the 'correct' way to do this is via JavaScript in the generated web page. Perhaps a reasonable initial default could be provided, e.g. *kai-default-plot-size*
and then the user or plotly/GR could update this value if they needed something bigger.
i made a mistake to put this in as x and y
x = '(4 . 1) y = '(11 . 1)
(kai:line x y)
(kai:show)
thrown an error
then I tried putting the correct data lists
'(1 2 3 4) '(5 6 7 8)
as x and y for kai:line
now calling show
throws the same error, and stack shows that the newest line
call did not replace the previous faulty data
The current package structure seems to follow some old recommendations in ASDF, the one package per file structure. In practice this has not proven to be a worthwhile structure, except for large project with a great deal of functionality in each file. In Kai, we end up with packages like kai.plotly.launch
, containing a single function. In these situations, the overhead of managing a fine grained package structure outweigh the benefits.
This proposal suggest to rationalise Kai under a single namespace, kai
and declare it in a top level file.
Not an issue actually, but more of a request.
Do you plan on adding kai
to Quicklisp?
Thanks!
Not sure how this could be done or I'd take a stab at it. Interactive plots, being able to manipulate the data and add labels, change scales, etc from the REPL would be an awesome feature for Kai. Perhaps by opening up a websocket and connecting to the browser that way?
In some environments, the default browser, the one the user normally uses, has JavaScript and other security measures in place that mean it cannot render Plotly. In these cases, an alternative browser can be installed specifically for rendering, however open-browser
is hard-coded to use explorer
(on MS Windows).
One solution is to specify the browser in an init file, e.g. kai-init.lisp, like so:
(defparameter *browser* "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe")
(defparameter *browser-options* "--app=")
and then launching it like this:
(uiop:run-program #+(or win32 mswindows windows)
`(,*browser*
,(concatenate 'string
*browser-options*
(namestring path-to-html)))
This also provides the ability to set browser options, like in this case where all the browser window controls are removed and only the plot is displayed.
To enable to plot pie chart
I noticed two backends: Plotly and GR. GR looks interesting. Two questions:
To enable to plot 3D data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.