Make Plot a locked Ziran package depending on Kryon
This commit is contained in:
1 parent
d49b7c6300
commit
ddc2e327e0
11 files changed
+79
-44
No files matched your search
@@ -1 +1,2 @@
|
||||
/build/
|
||||
/ziran.local.toml
|
||||
@@ -1,20 +1,21 @@
|
||||
.DEFAULT_GOAL := run
|
||||
.DEFAULT_GOAL := build
|
||||
|
||||
ZIRAN ?= ziran
|
||||
CC ?= cc
|
||||
ZIRAN_INCLUDE := $(shell $(ZIRAN) pkg path ziran)/include
|
||||
|
||||
.PHONY: run build check
|
||||
|
||||
run build:
|
||||
@$(MAKE) --silent --no-print-directory -C ../kryon build/bin/kryon
|
||||
@../kryon/build/bin/kryon $@
|
||||
$(ZIRAN) tool Kryon $@
|
||||
|
||||
check:
|
||||
@$(MAKE) --silent --no-print-directory -C ../kryon build/bin/kryon
|
||||
@../kryon/build/bin/kryon check
|
||||
@mkdir -p build/indicator-test-c
|
||||
@../ziran/build/bin/ziran build --target=c --entry indicator_test:main \
|
||||
--root tests --module-path src --module-path ../kryon/src/plot \
|
||||
--module-path ../kryon/src/ui -o build/indicator-test-c \
|
||||
$(ZIRAN) tool Kryon check
|
||||
mkdir -p build/indicator-test-c
|
||||
$(ZIRAN) build --project --target=c --entry indicator_test:main \
|
||||
-o build/indicator-test-c \
|
||||
tests/indicator_test.zi
|
||||
@$(CC) -std=c99 -pedantic-errors -I../ziran/include \
|
||||
$(CC) -std=c99 -pedantic-errors -I$(ZIRAN_INCLUDE) \
|
||||
-Ibuild/indicator-test-c build/indicator-test-c/*.c -lm \
|
||||
-o build/indicator-test
|
||||
@build/indicator-test
|
||||
build/indicator-test
|
||||
@@ -1,6 +1,6 @@
|
||||
# Plot
|
||||
|
||||
Plot is a reusable Ziran chart project for Kryon applications. Its candle
|
||||
Plot is a Ziran app package that depends on the separate Kryon package. Its candle
|
||||
chart draws OHLC bodies and wicks, volume, SMA 20, SMA 50, and EMA 20 over
|
||||
Kryon's generic `Plot` surface. `ChartMarker` and `CandleMarkers` add dated,
|
||||
clickable markers while leaving each marker's meaning to the caller. It also
|
||||
@@ -8,8 +8,14 @@ has a simple line chart. Both accept
|
||||
caller-owned values and colors; market data, networking, price formatting,
|
||||
and time labels stay in the application.
|
||||
|
||||
`make run` opens a small demo on the Cairo backend; `make check` checks the
|
||||
Ziran source without opening a window. Use `src/candle_chart.zi` or
|
||||
`src/line_chart.zi` from a project that already includes Kryon's UI modules.
|
||||
Atr links these sources from its `src/` directory so its existing build rules
|
||||
notice changes to Plot.
|
||||
Install the Ziran launcher once with `make install-user` in Ziran, then run
|
||||
`ziran fetch` and `make build` here. `make run` opens a small demo on the Cairo
|
||||
backend; `make check` checks the source and runs the nonvisual indicator test.
|
||||
The checked-in `ziran.lock` pins both Ziran and Kryon to exact commits. Plot
|
||||
exports `Plot/module.zi` for other packages. That module re-exports Plot's
|
||||
charts and Kryon's public UI surface; app code can use
|
||||
`using Charts :: #import "Plot";`.
|
||||
|
||||
Other applications can still use `src/candle_chart.zi` and
|
||||
`src/line_chart.zi` while packaging of reusable chart modules is being
|
||||
finished. Atr currently links those sources from its `src/` directory.
|
||||
@@ -1,5 +0,0 @@
|
||||
[project]
|
||||
default_profile = "cairo"
|
||||
|
||||
[profiles.cairo]
|
||||
backend = "desktop"
|
||||
@@ -0,0 +1,4 @@
|
||||
// Plot's reusable chart API, independent of the demo application's entry.
|
||||
using UI :: #import "Kryon";
|
||||
using Candle :: #import "candle_chart";
|
||||
using Line :: #import "line_chart";
|
||||
+1
-7
@@ -1,10 +1,4 @@
|
||||
#import "candle_chart"
|
||||
#import "drawing_props"
|
||||
#import "geometry"
|
||||
#import "paint_queue"
|
||||
#import "session"
|
||||
#import "text_props"
|
||||
#import "text_widget"
|
||||
using Charts :: #import "Plot";
|
||||
|
||||
#program_export
|
||||
Frame :: (session: Session, viewport: Rectangle) -> s32 {
|
||||
|
||||
+1
-8
@@ -1,11 +1,4 @@
|
||||
#import "drawing_props"
|
||||
#import "button_props"
|
||||
#import "button_widget"
|
||||
#import "geometry"
|
||||
#import "paint_queue"
|
||||
#import "plot_props"
|
||||
#import "plot_widget"
|
||||
#import "session"
|
||||
using UI :: #import "Kryon";
|
||||
|
||||
using PlotMode;
|
||||
|
||||
|
||||
+1
-6
@@ -1,9 +1,4 @@
|
||||
#import "drawing_props"
|
||||
#import "geometry"
|
||||
#import "paint_queue"
|
||||
#import "plot_props"
|
||||
#import "plot_widget"
|
||||
#import "session"
|
||||
using UI :: #import "Kryon";
|
||||
|
||||
using PlotMode;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#import "candle_chart"
|
||||
#import "geometry"
|
||||
using UI :: #import "Kryon";
|
||||
|
||||
#program_export
|
||||
main :: () -> s32 {
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"format": 1,
|
||||
"packages": [
|
||||
{
|
||||
"commit": "4235447bbd0fa9bf42dcc276381cb1c3dd55f5a2",
|
||||
"dependencies": {},
|
||||
"id": "pc63f351f658a1a15",
|
||||
"name": "Kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {
|
||||
"Kryon": "pc63f351f658a1a15"
|
||||
},
|
||||
"name": "Plot"
|
||||
},
|
||||
"toolchain": {
|
||||
"commit": "f3374188260b7c2fc497f0abed1d38fcb822547a",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/ziran.git"
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
[package]
|
||||
name = "Plot"
|
||||
entry = "src/app.zi"
|
||||
module_roots = ["src", "tests"]
|
||||
bridge_modules = ["app"]
|
||||
|
||||
[toolchain]
|
||||
git = "https://github.com/ziranlang/ziran.git"
|
||||
ref = "master"
|
||||
|
||||
[dependencies.Kryon]
|
||||
git = "https://github.com/kryonlabs/kryon.git"
|
||||
ref = "master"
|
||||
|
||||
[exports]
|
||||
Plot = "src/Plot/module.zi"
|
||||
|
||||
[tool.kryon]
|
||||
default_profile = "cairo"
|
||||
|
||||
[tool.kryon.profiles.cairo]
|
||||
backend = "desktop"
|
||||
Reference in new issue
Block a user