Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 15 additions & 27 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ permissions:
pages: write
id-token: write

# Layout mirrors tests.yml: daslang + dasImgui + dasImguiImplot are checked
# out as siblings, then daspkg-installed --global in dependency order (dasImgui
# first — the implot C++ module links dasModuleImgui and uses dasImgui's
# imgui headers). implot2rst then requires the v2 modules so RTTI can
# enumerate them, which needs both native .shared_modules built (hence the
# installs) and dasHV/dasGLFW baked into daslang (the -D flags below).
# Layout mirrors tests.yml: daslang (which contains dasImgui in-tree at
# modules/dasImgui — borisbat/dasImgui is archived) + dasImguiImplot are
# checked out, the imgui shared modules build from the daslang superbuild, and
# the overlay is daspkg-installed --global (the implot C++ module links
# dasModuleImgui and uses dasImgui's imgui headers). implot2rst then requires
# the v2 modules so RTTI can enumerate them, which needs the native
# .shared_modules built (hence the build targets + the install) and
# dasHV/dasGLFW baked into daslang (the -D flags below).
#
# Split into build + deploy jobs (same reason as dasImgui's docs.yml): attaching
# `environment: github-pages` to a job triggers GitHub's deployment-branch
Expand All @@ -46,13 +48,6 @@ jobs:
path: daslang-src
ref: master

- name: "Checkout dasImgui (dependency)"
uses: actions/checkout@v4
with:
# Path basename becomes the daspkg install dir basename.
repository: borisbat/dasImgui
path: dasImgui

- name: "Checkout dasImguiImplot"
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -93,13 +88,14 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-G Ninja
cmake --build ./build --parallel --target daslang
cmake --build ./build --parallel --target \
daslang dasModuleImgui imguiApp imguiAppHeadless
sccache --show-stats

- name: "Lint changed .das files"
# Mirrors dasImgui's docs.yml lint step, with both modules on the load
# path so the implot `require imgui/...` chain resolves without a daspkg
# install. (Unlike the node editor, implot ships no consumer lint rule.)
# The implot `require imgui/...` chain resolves natively from the in-tree
# dasImgui module; only the overlay itself needs -load_module. (Unlike
# the node editor, implot ships no consumer lint rule.)
working-directory: ${{ github.workspace }}/dasImguiImplot
run: |
set -eux
Expand All @@ -114,21 +110,13 @@ jobs:
echo "linting ${#CHANGED[@]} file(s): ${CHANGED[*]}"
# Serial (-j 1): parallel workers don't propagate -load_module.
${{ github.workspace }}/daslang-src/bin/daslang \
-load_module ${{ github.workspace }}/dasImgui \
-load_module ${{ github.workspace }}/dasImguiImplot \
${{ github.workspace }}/daslang-src/utils/lint/main.das -- \
"${CHANGED[@]}" --quiet -j 1

- name: "daspkg install dasImgui (global)"
# dasImgui first — the implot C++ module links dasModuleImgui and uses
# dasImgui's imgui headers (CMakeLists resolves it as a sibling).
run: |
set -eux
${{ github.workspace }}/daslang-src/bin/daslang \
${{ github.workspace }}/daslang-src/utils/daspkg/main.das -- \
install ${{ github.workspace }}/dasImgui --global

- name: "daspkg install dasImguiImplot (global)"
# dasImgui is in-tree (modules/dasImgui, built above) — only the
# implot overlay itself needs a daspkg install.
run: |
set -eux
${{ github.workspace }}/daslang-src/bin/daslang \
Expand Down
31 changes: 11 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Integration tests

# Headless live-driven integration suite for dasImguiImplot, mirroring
# dasImguiNodeEditor's tests.yml. ImPlot depends on dasImgui, so CI checks out
# BOTH packages and installs them in dependency order (dasImgui first — the
# implot C++ module links dasModuleImgui and uses dasImgui's imgui headers,
# see CMakeLists.txt). Tests run without a display server via the harness's
# --headless arm (ImGui context with a CPU font atlas, no GLFW window/GL ctx);
# dasImguiNodeEditor's tests.yml. ImPlot depends on dasImgui, which now lives
# in the daslang tree itself (modules/dasImgui — borisbat/dasImgui is archived),
# so CI checks out daslang + this overlay only; the imgui shared modules build
# from the daslang superbuild (the implot C++ module links dasModuleImgui and
# uses dasImgui's imgui headers, see CMakeLists.txt). Tests run without a
# display server via the harness's --headless arm (ImGui context with a CPU
# font atlas, no GLFW window/GL ctx);
# the HTTP live-API (port 9090) still serves so the playwright /status+/command+
# /shutdown flow is unchanged.
#
Expand Down Expand Up @@ -53,12 +55,6 @@ jobs:
path: daslang-src
ref: master

- name: "Checkout dasImgui (dependency)"
uses: actions/checkout@v4
with:
repository: borisbat/dasImgui
path: dasImgui

- name: "Checkout dasImguiImplot"
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -157,19 +153,14 @@ jobs:
cmake --build ./build --parallel --target \
daslang daslang-live \
dasModuleLiveHost dasModuleGlfw dasModuleHV \
dasModulePUGIXML dasModuleStbImage
dasModulePUGIXML dasModuleStbImage \
dasModuleImgui imguiApp imguiAppHeadless
sccache --show-stats
echo "BIN_DIR=bin" >> "$GITHUB_ENV"

- name: "daspkg install dasImgui (global)"
# dasImgui first — the implot C++ module links dasModuleImgui and uses
# dasImgui's imgui headers (CMakeLists.txt resolves it as a sibling).
working-directory: daslang-src
run: |
set -eux
${BIN_DIR}/daslang utils/daspkg/main.das -- install ../dasImgui --global

- name: "daspkg install dasImguiImplot (global)"
# dasImgui is in-tree (modules/dasImgui, built above) — only the
# implot overlay itself needs a daspkg install.
working-directory: daslang-src
run: |
set -eux
Expand Down
7 changes: 4 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dasImguiImplot is the daslang binding + boost-v2 wrapper layer for
[ImPlot](https://github.com/epezent/implot) (v0.16, vendored), an immediate-mode
plotting library for Dear ImGui. It is built **on top of
[dasImgui](https://github.com/borisbat/dasImgui)** and mirrors its conventions —
dasImgui** (part of the daslang tree, `modules/dasImgui`) and mirrors its conventions —
`[container]` macros, the snapshot/telemetry rail, the `imgui_harness` lifecycle,
dastest integration tests, and the `daslang-live` HTTP driver. **Read dasImgui's
`CLAUDE.md` first** for all of that shared machinery; this file documents only what is
Expand Down Expand Up @@ -135,15 +135,16 @@ daslang-live subprocesses else pop real windows and flake). Mixed dir: dastest r
`[test]` files and in-process `def main : int` smokes (exit-0 = PASS) side by side.

```
daslang -load_module D:/DASPKG/dasImgui -load_module D:/DASPKG/dasImguiImplot \
daslang -load_module D:/DASPKG/dasImguiImplot \
D:/Work/daScript/dastest/dastest.das -- --test modules/dasImguiImplot/tests/integration \
--timeout 600 --isolated-mode --isolated-mode-threads 4 --headless
```

CI: `.github/workflows/tests.yml` (ubuntu/macos; Windows deferred — builds + passes
locally under MSVC, opportunistic re-enable) + `docs.yml` (lint changed `.das` →
`utils/implot2rst.das` → stub/Uncategorized gates → `sphinx-build -W` → Pages on master).
Both `daspkg install ../dasImgui` THEN `../dasImguiImplot` (dependency order).
Both workflows `daspkg install ../dasImguiImplot` only — dasImgui is in-tree
(`modules/dasImgui`, built by the daslang superbuild).

**Test helpers (`imgui_implot_playwright`)** — `implot_open(app, plot_path)` returns a
`PlotSession {app, plot}` (just the pair — ImPlot is stateless, no handle); readers pull
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ELSE()
get_filename_component(MODULES_DIR "${DAS_IMPLOT_DIR}" DIRECTORY)
SET(DAS_IMGUI_DIR "${MODULES_DIR}/dasImgui")
if(NOT EXISTS "${DAS_IMGUI_DIR}/src/cb_dasIMGUI.h")
message(FATAL_ERROR "dasImgui not found at ${DAS_IMGUI_DIR}. Install it first: daspkg install github.com/borisbat/dasImgui")
message(FATAL_ERROR "dasImgui not found at ${DAS_IMGUI_DIR}. dasImgui is part of the daslang tree (modules/dasImgui) — build daslang first, or point DASLANG_DIR at a daslang tree and install this package under its modules/ (daspkg install).")
endif()

# imgui headers (from dasImgui's FetchContent download)
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
plotting library for Dear ImGui, usable from daslang scripts.

Sibling project to [dasImguiNodeEditor](https://github.com/borisbat/dasImguiNodeEditor);
it depends on, but does not modify, [dasImgui](https://github.com/borisbat/dasImgui)
— both can be loaded together.
it depends on, but does not modify, dasImgui — which ships as part of the
[daslang](https://github.com/GaijinEntertainment/daScript) tree itself
(`modules/dasImgui`), so no separate dasImgui install is needed.

## Status

Expand All @@ -23,29 +24,31 @@ are in progress.

## Requirements

- daslang SDK (with dynamic-module support)
- [dasImgui](https://github.com/borisbat/dasImgui)
- daslang SDK (with dynamic-module support) — dasImgui is part of the daslang
tree (`modules/dasImgui`), so building daslang provides it
- CMake 3.16+, a C++17 compiler (MSVC / GCC / Clang)

## Build

Via daspkg (installs dasImgui first, then builds this module):
Via daspkg (dasImgui already ships with daslang; this builds just the overlay):

```
daspkg install github.com/borisbat/dasImguiImplot
```

Or configure the native module directly (dasImgui must be a sibling, already built):
Or configure the native module directly (the package must sit next to
`modules/dasImgui` in a daslang tree, with dasImgui already built):

```
cmake -S . -B _build -DDASLANG_DIR=<daslang-sdk-root>
cmake --build _build --config Release
```

This produces `dasModuleImplot.shared_module`. Load it alongside dasImgui:
This produces `dasModuleImplot.shared_module`. Load it (in-tree dasImgui
resolves natively — no extra `-load_module` for it):

```
daslang -load_module <path>/dasImgui -load_module <path>/dasImguiImplot script.das
daslang -load_module <path>/dasImguiImplot script.das
```

## License
Expand Down
Loading