Skip to content

Commit 9255630

Browse files
authored
Merge pull request #22 from timkpaine/tkp/tests
rename to daggre
2 parents c78e1f7 + dc11fa2 commit 9255630

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+926
-467
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ current_version = 0.1.0
33
commit = True
44
tag = False
55

6-
[bumpversion:file:python/dagred3/__init__.py]
6+
[bumpversion:file:python/daggre/__init__.py]
77
search = __version__ = "{current_version}"
88
replace = __version__ = "{new_version}"
99

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 the dagre-d3-lite authors
189+
Copyright 2023 the daggre authors
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# dagre-d3-lite
2-
A convenience layer on top of `dagre-d3` (`dagre-d3-es`), for use in [ipydagred3](https://github.com/timkpaine/ipydagred3). Built on [transports](https://github.com/timkpaine/transports).
1+
# daggre
2+
A convenience layer on top of `dagre-d3` (`dagre-d3-es`), for use in [ipydagred3](https://github.com/timkpaine/ipydaggre). Built on [transports](https://github.com/timkpaine/transports).
33

4-
[![Build Status](https://github.com/timkpaine/dagre-d3-lite/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/timkpaine/dagre-d3-lite/actions?query=workflow%3A%22Build+Status%22)
5-
[![codecov](https://codecov.io/gh/timkpaine/dagre-d3-lite/branch/main/graph/badge.svg?token=3N6NOPL4RE)](https://codecov.io/gh/timkpaine/dagre-d3-lite)
6-
[![License](https://img.shields.io/github/license/timkpaine/dagre-d3-lite)](https://github.com/timkpaine/dagre-d3-lite)
7-
[![PyPI](https://img.shields.io/pypi/v/dagred3.svg)](https://pypi.python.org/pypi/dagred3)
8-
[![npm](https://img.shields.io/npm/v/dagre-d3-lite.svg)](https://www.npmjs.com/package/dagre-d3-lite)
4+
[![Build Status](https://github.com/timkpaine/daggre/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/timkpaine/daggre/actions?query=workflow%3A%22Build+Status%22)
5+
[![codecov](https://codecov.io/gh/timkpaine/daggre/branch/main/graph/badge.svg?token=3N6NOPL4RE)](https://codecov.io/gh/timkpaine/daggre)
6+
[![License](https://img.shields.io/github/license/timkpaine/daggre)](https://github.com/timkpaine/daggre)
7+
[![PyPI](https://img.shields.io/pypi/v/daggre.svg)](https://pypi.python.org/pypi/daggre)
8+
[![npm](https://img.shields.io/npm/v/daggre.svg)](https://www.npmjs.com/package/daggre)

examples/ipc/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from fastapi import FastAPI, WebSocket
99

1010
sys.path.append("../../python") # noqa
11-
from dagred3 import Graph # noqa: E402
12-
from dagred3 import (AioHttpWebSocketClient, JSONTransport,
13-
StarletteWebSocketServer)
11+
from daggre import Graph # noqa: E402
12+
from daggre import (AioHttpWebSocketClient, JSONTransport,
13+
StarletteWebSocketServer)
1414

1515

1616
def run_server():

examples/js/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<script type="importmap">
88
{
99
"imports": {
10-
"dagre-d3-lite": "../../js/dist/index.js"
10+
"daggre": "../../js/dist/index.js"
1111
}
1212
}
1313
</script>
1414
<script type="module" src="index.js"></script>
1515
</head>
16-
<body><div class="dagred3"></div></body>
16+
<body><div class="daggre"></div></body>
1717
</html>

examples/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
import { Graph } from "dagre-d3-lite";
2+
import { Graph } from "daggre";
33

44
const SCALE = 10;
55

66
document.addEventListener("DOMContentLoaded", () => {
7-
const div = document.querySelector("div.dagred3");
7+
const div = document.querySelector("div.daggre");
88
const graph = new Graph({ direction: "left-to-right" });
99

1010
let begin = 0;

examples/python/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<script type="importmap">
88
{
99
"imports": {
10-
"dagre-d3-lite": "../../js/dist/index.js"
10+
"daggre": "../../js/dist/index.js"
1111
}
1212
}
1313
</script>
1414
<script type="module" src="index.js"></script>
1515
</head>
16-
<body><div class="dagred3"></div></body>
16+
<body><div class="daggre"></div></body>
1717
</html>

examples/python/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
import { Graph, WebSocketClient, JSONTransport } from "dagre-d3-lite";
2+
import { Graph, WebSocketClient, JSONTransport } from "daggre";
33

44
document.addEventListener("DOMContentLoaded", async () => {
55
const jst = new JSONTransport();
@@ -8,7 +8,7 @@ document.addEventListener("DOMContentLoaded", async () => {
88
jst.hosts(Graph);
99
try {
1010
const graph = await handler.initial();
11-
const div = document.querySelector("div.dagred3");
11+
const div = document.querySelector("div.daggre");
1212
graph.render(div);
1313
await handler.handle();
1414
} catch {

examples/python/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from fastapi.staticfiles import StaticFiles
1111

1212
sys.path.append("../../python") # noqa
13-
from dagred3 import JSONTransport # noqa: E402
14-
from dagred3 import Graph, StarletteWebSocketServer
13+
from daggre import JSONTransport # noqa: E402
14+
from daggre import Graph, StarletteWebSocketServer
1515

1616

1717
def build_app():

js/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "dagre-d3-lite",
2+
"name": "daggre",
33
"version": "0.1.0",
44
"description": "Convenience layer for dagre-d3",
55
"main": "dist/iexjs.js",
6-
"repository": "git@github.com:timkpaine/dagre-d3-lite.git",
6+
"repository": "git@github.com:timkpaine/daggre.git",
77
"author": "Tim Paine <t.paine154@gmail.com>",
88
"license": "Apache-2.0",
99
"type": "module",
@@ -16,7 +16,7 @@
1616
],
1717
"scripts": {
1818
"build:esbuild": "esbuild src/index.js --bundle --format=esm --outdir=dist/",
19-
"build:python": "esbuild src/index.js --bundle --format=esm --outdir=../python/dagred3/static/",
19+
"build:python": "esbuild src/index.js --bundle --format=esm --outdir=../python/daggre/static/",
2020
"build": "npm-run-all -p build:*",
2121
"clean": "rimraf dist lib",
2222
"fix": "yarn lint --fix",

js/src/core/graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export class Graph extends Model {
256256
// only run on first rendering
257257
if (!this._rendered) {
258258
// add class to `renderpoint`
259-
renderpoint.classList.add("dagred3-container");
259+
renderpoint.classList.add("daggre-container");
260260

261261
// create svg and g elements
262262
this._graph_svg_inst = d3.select(renderpoint).append("svg");

js/src/index.css

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
div.dagred3-container {
1+
div.daggre-container {
22
/* min-height: 600px; */
33
/* min-width: 800px; */
44
/* resize: both; */
55
}
6-
7-
div.dagred3-container > svg {
6+
7+
div.daggre-container > svg {
88
height: 100%;
99
width: 100%;
1010
}
11-
12-
.dagred3-container .node rect,
13-
.dagred3-container .node circle,
14-
.dagred3-container .node ellipse,
15-
.dagred3-container .node polygon {
11+
12+
.daggre-container .node rect,
13+
.daggre-container .node circle,
14+
.daggre-container .node ellipse,
15+
.daggre-container .node polygon {
1616
stroke: #555;
1717
fill: #fff;
1818
}
19-
20-
.dagred3-container .edgePath path {
19+
20+
.daggre-container .edgePath path {
2121
stroke: #555;
2222
fill: transparent;
2323
stroke-width: 1.5px;
2424
}
25-
26-
.dagred3-container .edgeLabel foreignObject {
25+
26+
.daggre-container .edgeLabel foreignObject {
2727
overflow: visible;
2828
}
29-
30-
.dagred3-container .edgeLabel foreignObject u {
29+
30+
.daggre-container .edgeLabel foreignObject u {
3131
text-decoration: none;
3232
}
33-
34-
.dagred3-container .node text {
33+
34+
.daggre-container .node text {
3535
pointer-events: none;
3636
}
37-
38-
39-
div.dagred3-tooltip {
37+
38+
39+
div.daggre-tooltip {
4040
background-color: rgba(255, 255, 255, .8);
4141
border: 1px solid #555;
4242
padding: 15px;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"name": "dagre-d3-lite",
4-
"repository": "git@github.com:timkpaine/dagre-d3-lite.git",
3+
"name": "daggre",
4+
"repository": "git@github.com:timkpaine/daggre.git",
55
"author": "Tim Paine <t.paine154@gmail.com>",
66
"license": "Apache-2.0",
77
"type": "module",

python/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 the dagre-d3-lite authors
189+
Copyright 2023 the daggre authors
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

python/MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ include README.md
33

44
include pyproject.toml
55

6-
graft dagred3
7-
graft dagred3/static
6+
graft daggre
7+
graft daggre/static
88

99
# get rid of test and lint artifacts
1010
prune .pytest_cache

python/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ install: prebuild ## install to site-packages
2020
# Testing #
2121
###########
2222
test: ## Clean and Make unit tests
23-
python -m pytest -v dagred3/tests --junitxml=junit.xml --cov=dagred3 --cov-branch --cov-fail-under=75 --cov-report term-missing --cov-report xml
23+
python -m pytest -v daggre/tests --junitxml=junit.xml --cov=daggre --cov-branch --cov-fail-under=75 --cov-report term-missing --cov-report xml
2424

2525
tests: test
2626

2727
###########
2828
# Linting #
2929
###########
3030
lint: ## Black/flake8 python
31-
python -m ruff check dagred3 setup.py
31+
python -m ruff check daggre setup.py
3232
python -m ruff check ../examples/*/*.py
33-
python -m isort dagred3 setup.py --check
33+
python -m isort daggre setup.py --check
3434
python -m isort ../examples/*/*.py --check
3535

3636

3737
fix: ## Black python
38-
python -m ruff format dagred3 setup.py
38+
python -m ruff format daggre setup.py
3939
python -m ruff format ../examples/*/*.py
40-
python -m isort dagred3 setup.py
40+
python -m isort daggre setup.py
4141
python -m isort ../examples/*/*.py
4242

4343
format: fix
@@ -53,7 +53,7 @@ check-manifest: prebuild ## run manifest checker for sdist
5353
check-manifest -v
5454

5555
annotate: ## run mypy type annotation
56-
mypy dagred3/
56+
mypy daggre/
5757

5858
################
5959
# Distribution #
@@ -72,7 +72,7 @@ clean: ## clean the repository
7272
find . -name "*.pyc" | xargs rm -rf
7373
find . -name ".ipynb_checkpoints" | xargs rm -rf
7474
rm -rf .coverage coverage *.xml build dist *.egg-info lib node_modules .pytest_cache *.egg-info
75-
rm -rf dagred3/labextension dagred3/nbextension/static/index*
75+
rm -rf daggre/labextension daggre/nbextension/static/index*
7676
git clean -fd
7777

7878
###########

python/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# dagre-d3-lite
2-
A convenience layer on top of `dagre-d3` (`dagre-d3-es`), for use in [ipydagred3](https://github.com/timkpaine/ipydagred3). Built on [transports](https://github.com/timkpaine/transports).
1+
# daggre
2+
A convenience layer on top of `dagre-d3` (`dagre-d3-es`), for use in [ipydagred3](https://github.com/timkpaine/ipydaggre). Built on [transports](https://github.com/timkpaine/transports).
33

4-
[![Build Status](https://github.com/timkpaine/dagre-d3-lite/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/timkpaine/dagre-d3-lite/actions?query=workflow%3A%22Build+Status%22)
5-
[![codecov](https://codecov.io/gh/timkpaine/dagre-d3-lite/branch/main/graph/badge.svg?token=3N6NOPL4RE)](https://codecov.io/gh/timkpaine/dagre-d3-lite)
6-
[![License](https://img.shields.io/github/license/timkpaine/dagre-d3-lite)](https://github.com/timkpaine/dagre-d3-lite)
7-
[![PyPI](https://img.shields.io/pypi/v/dagred3.svg)](https://pypi.python.org/pypi/dagred3)
8-
[![npm](https://img.shields.io/npm/v/dagre-d3-lite.svg)](https://www.npmjs.com/package/dagre-d3-lite)
4+
[![Build Status](https://github.com/timkpaine/daggre/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/timkpaine/daggre/actions?query=workflow%3A%22Build+Status%22)
5+
[![codecov](https://codecov.io/gh/timkpaine/daggre/branch/main/graph/badge.svg?token=3N6NOPL4RE)](https://codecov.io/gh/timkpaine/daggre)
6+
[![License](https://img.shields.io/github/license/timkpaine/daggre)](https://github.com/timkpaine/daggre)
7+
[![PyPI](https://img.shields.io/pypi/v/daggre.svg)](https://pypi.python.org/pypi/daggre)
8+
[![npm](https://img.shields.io/npm/v/daggre.svg)](https://www.npmjs.com/package/daggre)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

python/daggre/static/index.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* src/index.css */
2+
div.daggre-container {
3+
}
4+
div.daggre-container > svg {
5+
height: 100%;
6+
width: 100%;
7+
}
8+
.daggre-container .node rect,
9+
.daggre-container .node circle,
10+
.daggre-container .node ellipse,
11+
.daggre-container .node polygon {
12+
stroke: #555;
13+
fill: #fff;
14+
}
15+
.daggre-container .edgePath path {
16+
stroke: #555;
17+
fill: transparent;
18+
stroke-width: 1.5px;
19+
}
20+
.daggre-container .edgeLabel foreignObject {
21+
overflow: visible;
22+
}
23+
.daggre-container .edgeLabel foreignObject u {
24+
text-decoration: none;
25+
}
26+
.daggre-container .node text {
27+
pointer-events: none;
28+
}
29+
div.daggre-tooltip {
30+
background-color: rgba(255, 255, 255, .8);
31+
border: 1px solid #555;
32+
padding: 15px;
33+
}

0 commit comments

Comments
 (0)