Skip to content

Commit 8ba3412

Browse files
authored
Merge pull request #3 from compas-dev/rename-to-compas-plotter
Rename package compas_plotters -> compas_plotter
2 parents 9a28b2c + d6eac27 commit 8ba3412

34 files changed

Lines changed: 98 additions & 98 deletions

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- uses: compas-dev/compas-actions.docs@v5
1818
with:
1919
github_token: ${{ secrets.GITHUB_TOKEN }}
20-
doc_url: https://compas.dev/compas_plotters
20+
doc_url: https://compas.dev/compas_plotter
2121
generator: mkdocs

AGENTS.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# AGENTS.md
22

3-
Guidance for AI coding agents (and humans) working on **compas_plotters**.
3+
Guidance for AI coding agents (and humans) working on **compas_plotter**.
44
This is the canonical onboarding doc; `CLAUDE.md` just imports it.
55

66
## What this is
77

8-
`compas_plotters` is the COMPAS 2.x revival of the 2D matplotlib visualisation
8+
`compas_plotter` is the COMPAS 2.x revival of the 2D matplotlib visualisation
99
package that shipped inside COMPAS up to 1.17. It draws COMPAS geometry and data
1010
structures onto a matplotlib canvas via the modern `compas.scene` system, by
1111
registering a `"Plotter"` visualisation context — the same mechanism the Rhino,
@@ -16,22 +16,22 @@ to PyPI and the GitHub repo may not exist yet.
1616

1717
## Architecture in 60 seconds
1818

19-
- **`Plotter`** ([src/compas_plotters/plotter.py](src/compas_plotters/plotter.py)) —
19+
- **`Plotter`** ([src/compas_plotter/plotter.py](src/compas_plotter/plotter.py)) —
2020
wraps a matplotlib figure/axes. Public API: `add`, `add_from_list`, `find`,
2121
`zoom_extents`, `draw`, `redraw`, `show`, `save`, `pause`, `register_listener`,
2222
`on` (dynamic/animation + GIF).
23-
- **`PlotterScene(compas.scene.Scene)`** ([scene/plotterscene.py](src/compas_plotters/scene/plotterscene.py)) —
23+
- **`PlotterScene(compas.scene.Scene)`** ([scene/plotterscene.py](src/compas_plotter/scene/plotterscene.py)) —
2424
the container. Every `Plotter` owns one (`plotter.scene`), context hardcoded to
2525
`"Plotter"`. `Plotter.add` delegates to `PlotterScene.add`, which injects the
2626
owning plotter into each scene object and draws it. This gives a real scene tree
2727
(parent/child, composed `worldtransformation`) and serialization. Pattern copied
2828
from `compas_viewer`'s `ViewerScene`.
29-
- **`PlotterSceneObject`** ([scene/plotterobject.py](src/compas_plotters/scene/plotterobject.py)) —
29+
- **`PlotterSceneObject`** ([scene/plotterobject.py](src/compas_plotter/scene/plotterobject.py)) —
3030
base for all drawable objects. Subclasses implement `draw()` (returns the list
3131
of matplotlib artists, stored on `self._mpl_objects`) and `viewdata()` (the
3232
`[x, y]` points used by `zoom_extents`). `clear()` and `redraw()` are provided.
3333
Also exposes helpers `to_rgb()` and `to_color()`.
34-
- **Registration** ([scene/__init__.py](src/compas_plotters/scene/__init__.py)) —
34+
- **Registration** ([scene/__init__.py](src/compas_plotter/scene/__init__.py)) —
3535
`@plugin(category="factories") register_scene_objects()` maps each COMPAS type
3636
to its object with `register(T, O, context="Plotter")`. It is **also called
3737
eagerly at import** so the package works without entry-point discovery (editable
@@ -113,22 +113,22 @@ python -m mkdocs serve # live docs preview
113113
There are two patterns already in the tree — copy the closest one.
114114

115115
**A. A single COMPAS type → dedicated object.** See
116-
[scene/circleobject.py](src/compas_plotters/scene/circleobject.py) (geometry) or
117-
[scene/boxobject.py](src/compas_plotters/scene/boxobject.py) (shape).
116+
[scene/circleobject.py](src/compas_plotter/scene/circleobject.py) (geometry) or
117+
[scene/boxobject.py](src/compas_plotter/scene/boxobject.py) (shape).
118118

119119
1. Create `scene/<thing>object.py` with
120120
`class <Thing>Object(PlotterSceneObject, GeometryObject)` (or `MeshObject` /
121121
`GraphObject` base for data structures).
122122
2. Implement `__init__` (call `super().__init__(zorder=..., **kwargs)`; set your
123123
style attrs), `viewdata()`, and `draw()` (build matplotlib artists, append to
124124
`self._mpl_objects`, `return self._mpl_objects`).
125-
3. In [scene/__init__.py](src/compas_plotters/scene/__init__.py): import it, add
125+
3. In [scene/__init__.py](src/compas_plotter/scene/__init__.py): import it, add
126126
`register(<Thing>, <Thing>Object, context="Plotter")` inside
127127
`register_scene_objects()`, and add it to `__all__`.
128128
4. Add a test in [tests/test_plotter.py](tests/test_plotter.py) and a CHANGELOG entry.
129129

130130
**B. A family of types → one shared object.** See
131-
[scene/shapeobject.py](src/compas_plotters/scene/shapeobject.py): `ShapeObject`
131+
[scene/shapeobject.py](src/compas_plotter/scene/shapeobject.py): `ShapeObject`
132132
tessellates any `Shape` with `to_vertices_and_faces()` and projects to XY; the
133133
registration loop maps several classes to it.
134134

@@ -138,7 +138,7 @@ Breps and surfaces are the main remaining gap. Plan: tessellate to a mesh
138138
(`Brep.to_tesselation()` / surface sampling) and project to XY, mirroring
139139
`ShapeObject`. Breps require an optional backend (e.g. `compas_occ`), so register
140140
them inside a `try/except ImportError` block (see git history of
141-
[scene/__init__.py](src/compas_plotters/scene/__init__.py) for the guarded pattern).
141+
[scene/__init__.py](src/compas_plotter/scene/__init__.py) for the guarded pattern).
142142

143143
## Release
144144

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
* Initial COMPAS 2.x port of `compas_plotters`.
12+
* Initial COMPAS 2.x port of `compas_plotters` (the package that shipped inside COMPAS up to 1.17).
1313
* `Plotter` class for 2D matplotlib visualisation, including dynamic plotting
1414
(`Plotter.on`) with optional GIF recording.
1515
* `"Plotter"` visualisation context built on `compas.scene`.

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ authors:
1212
- family-names: "Casas"
1313
given-names: "Gonzalo"
1414
affiliation: "ETH Zurich"
15-
url: "https://github.com/compas-dev/compas_plotters"
16-
repository-code: "https://github.com/compas-dev/compas_plotters"
15+
url: "https://github.com/compas-dev/compas_plotter"
16+
repository-code: "https://github.com/compas-dev/compas_plotter"
1717
license: MIT
1818
version: "0.1.0"
1919
date-released: 2026-06-30

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# COMPAS Plotters
22

3-
![build](https://github.com/compas-dev/compas_plotters/workflows/build/badge.svg)
4-
[![License](https://img.shields.io/github/license/compas-dev/compas_plotters.svg)](https://github.com/compas-dev/compas_plotters/blob/main/LICENSE)
5-
[![PyPI](https://img.shields.io/pypi/v/compas_plotters.svg)](https://pypi.org/project/compas_plotters/)
3+
![build](https://github.com/compas-dev/compas_plotter/workflows/build/badge.svg)
4+
[![License](https://img.shields.io/github/license/compas-dev/compas_plotter.svg)](https://github.com/compas-dev/compas_plotter/blob/main/LICENSE)
5+
[![PyPI](https://img.shields.io/pypi/v/compas_plotter.svg)](https://pypi.org/project/compas_plotter/)
66

77
**2D visualisation of COMPAS geometry and data structures, powered by matplotlib.**
88

9-
`compas_plotters` provides a lightweight, dependency-free (other than matplotlib)
9+
`compas_plotter` provides a lightweight, dependency-free (other than matplotlib)
1010
way to draw COMPAS objects in 2D. It is the COMPAS 2.x successor of the
1111
`compas_plotters` package that shipped inside COMPAS up to version 1.17, rebuilt
1212
on top of the modern [`compas.scene`](https://compas.dev/compas/latest/) system.
@@ -16,15 +16,15 @@ registered plotter scene object can be drawn with a single `plotter.add(...)`.
1616
## Installation
1717

1818
```bash
19-
pip install compas_plotters
19+
pip install compas_plotter
2020
```
2121

2222
## Quick start
2323

2424
```python
2525
from compas.geometry import Point, Line, Polygon
2626
from compas.datastructures import Mesh
27-
from compas_plotters import Plotter
27+
from compas_plotter import Plotter
2828

2929
plotter = Plotter(figsize=(8, 5))
3030

@@ -62,8 +62,8 @@ Planned additions, most likely drawn as XY projections following the existing
6262
## Documentation
6363

6464
Full documentation is available at
65-
[compas.dev/compas_plotters](https://compas.dev/compas_plotters).
65+
[compas.dev/compas_plotter](https://compas.dev/compas_plotter).
6666

6767
## License
6868

69-
`compas_plotters` is released under the [MIT License](LICENSE).
69+
`compas_plotter` is released under the [MIT License](LICENSE).

docs/api/compas_plotter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ::: compas_plotter.Plotter

docs/api/compas_plotter.scene.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ::: compas_plotter.scene

docs/api/compas_plotters.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/api/compas_plotters.scene.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# API Reference
22

3-
The public API of `compas_plotters` is small:
3+
The public API of `compas_plotter` is small:
44

5-
- **[compas_plotters](compas_plotters.md)** — the [`Plotter`][compas_plotters.Plotter]
5+
- **[compas_plotter](compas_plotter.md)** — the [`Plotter`][compas_plotter.Plotter]
66
class, the main entry point for building 2D plots.
7-
- **[compas_plotters.scene](compas_plotters.scene.md)** — the `"Plotter"`
7+
- **[compas_plotter.scene](compas_plotter.scene.md)** — the `"Plotter"`
88
visualisation-context scene objects, one per supported COMPAS type. You rarely
99
instantiate these directly; `Plotter.add` creates them for you.

0 commit comments

Comments
 (0)