Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
538b567
Upgrade @cosmograph/cosmograph to 2.0.0-beta.18
Stukova Mar 13, 2025
2ade46b
Add API key support for Cosmograph (wip)
Stukova Apr 10, 2025
1fe984f
Enhance error handling and improve API key management
Stukova Apr 16, 2025
dae2e58
Upgrade @cosmograph/cosmograph to 2.0.0-beta.20
Stukova Apr 23, 2025
86039aa
Implement caching for Arrow table conversion
Stukova Apr 23, 2025
a2b4956
Upgrade to Cosmograph v2.0.0-beta.24, refactor project export flow
Stukova Jul 3, 2025
3aa1fef
Replace rectangular selection with polygonal selection
Stukova Jul 4, 2025
2b15631
Move fitViewButton and selectAreaButton to left top corner
Stukova Jul 4, 2025
d44e694
Reorganize legend layout to match Cosmograph app
Stukova Jul 9, 2025
d75e7cc
Upgrade to Cosmograph v2.0.0-beta.25
Stukova Jul 9, 2025
ac17c72
Reduce export logging and show project URL
Stukova Jul 10, 2025
7f05523
Add API key and export project documentation
Stukova Jul 10, 2025
f4710aa
Improve error handling and validation across widget module
Stukova Jul 10, 2025
ce5cd3a
Fix indentation and enable additional linting rules
Stukova Jul 12, 2025
143e372
Add null safety and input validation
Stukova Jul 12, 2025
792a501
Pre-release 0.0.47b0
Stukova Jul 12, 2025
cdb36e7
Upgrade cosmograph widget with enhanced labeling, selection, and disp…
Stukova Aug 20, 2025
47e4ad1
Upgrade to Cosmograph v2.0.0-beta.26
Stukova Aug 20, 2025
33bfd94
Handle undefined values in config property filtering
Stukova Aug 25, 2025
2d87edd
Release 1.0.0b0
Stukova Aug 26, 2025
58a9b4e
Simplify cosmo() API and add parameter docstrings
Stukova Oct 16, 2025
25c2d0c
Update dependencies and disable unsupported ingress test
Stukova Oct 16, 2025
56b41a1
Add Python 3.12 development environment configuration
Stukova Oct 16, 2025
2f1620e
Reorganize control buttons layout and fix zoom button styling
Stukova Oct 16, 2025
1f22c55
Support both string and string[] for linkTargetBy property
Stukova Oct 16, 2025
7e6fe61
Implement link timeline support
Stukova Oct 16, 2025
bdf37ff
Add loading indicator for Cosmograph widget initialization
Stukova Oct 17, 2025
5bc922a
Add settings panel and point info panel UI components
Stukova Oct 17, 2025
4d6ae81
Set scale_points_on_zoom to true by default
Stukova Oct 17, 2025
b854eca
Release 1.0.0b1
Stukova Oct 18, 2025
e459fb8
Set show_hovered_point_label to true by default
Stukova Oct 18, 2025
7b58848
Test export_project_by_name in Mobiuse example
Stukova Oct 18, 2025
bf61735
Add debug mode and fix phantom column refs in config
Stukova Oct 18, 2025
294b93b
Release 0.5.0b0
Stukova Oct 18, 2025
4d8bccb
Release 0.5.0
rokotyan Oct 21, 2025
ea8f966
Upgrade to Cosmograph v2.0.0-beta.28
Stukova Oct 22, 2025
658a6e8
Release 0.5.1
Stukova Oct 22, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@ node_modules
meta.json

cosmograph/widget/static
.cosmograph_cache
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,64 @@ Zooming in a bit:

![image](https://github.com/user-attachments/assets/e988950d-9f53-40c2-8b77-18cfb92efb50)

## 🔑 API Key Setup and Project Export

### Setting up API Key

If you have a Cosmograph API key, you can set it globally to authenticate with Cosmograph services:

```python
from cosmograph import set_api_key

# Set your API key globally (this will apply to all cosmograph instances)
set_api_key("your-api-key-here")
```

Once set, all cosmograph widgets will automatically use this API key for authentication.

### Exporting Projects to Cosmograph Platform

You can export your cosmograph visualization as a project to the [Cosmograph platform](https://run.cosmograph.app), making it accessible via a web interface for sharing and further collaboration.

```python
import pandas as pd
from cosmograph import cosmo, set_api_key

# Set your API key first
set_api_key("your-api-key-here")

# Create your visualization
points = pd.DataFrame({
'id': [1, 2, 3, 4, 5],
'label': ['Node A', 'Node B', 'Node C', 'Node D', 'Node E'],
'value': [10, 20, 15, 25, 30],
'category': ['A', 'B', 'A', 'B', 'A']
})

links = pd.DataFrame({
'source': [1, 2, 3, 1, 2],
'target': [2, 3, 4, 5, 4],
'value': [1.0, 2.0, 1.5, 0.5, 1.8]
})

graph = cosmo(
points=points,
links=links,
point_id_by='id',
link_source_by='source',
link_target_by='target',
point_color_by='category',
point_label_by='label',
point_size_by='value'
)

# Export to Cosmograph platform
graph.export_project_by_name("My Network Visualization")
```

The exported project will be available on the [Cosmograph platform](https://run.cosmograph.app).


## 🎉 More Examples

Try out the Cosmograph widget in Google Colab with these example notebooks:
Expand Down
2 changes: 1 addition & 1 deletion cosmograph/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package metadata for cosmograph"""

__version__ = "0.0.47"
__version__ = "1.0.0b0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Double‑check PEP 440 compliance of “b0”, packaging single source of truth, and install docs.

  • PEP 440 pre-release numbering is slightly nuanced; “b1” is more common than “b0”. Please verify that “1.0.0b0” parses as expected in your publishing pipeline and that tools (pip, twine, packaging) accept it.
  • Ensure your build config sources the version from this file (to avoid drift). If pyproject uses a literal version, keep it in sync or switch to dynamic version = attr.
  • Since pre-releases aren’t installed by default with “pip install cosmograph”, update README/docs to include installation guidance for testers (e.g., “pip install --pre cosmograph” or pin to 1.0.0b0), especially since this PR advertises new APIs.

If you prefer to avoid any edge cases and align with common practice, you can bump to b1:

-__version__ = "1.0.0b0"
+__version__ = "1.0.0b1"

Run this script to validate PEP 440 compliance, detect other version declarations, and scan docs for install guidance:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "==> Extract and validate __version__ with packaging"
python - <<'PY'
import re, sys, pathlib
from packaging.version import Version, InvalidVersion
p = pathlib.Path('cosmograph/__about__.py')
text = p.read_text(encoding='utf-8')
m = re.search(r'__version__\s*=\s*[\'"]([^\'"]+)[\'"]', text)
ver = m.group(1) if m else None
print(f"__about__.__version__ = {ver}")
try:
    v = Version(ver)
    print(f"PEP 440 normalized: {v.public}")
except InvalidVersion as e:
    print(f"Invalid PEP 440 version: {e}", file=sys.stderr); sys.exit(1)
from packaging.version import Version
prev = Version("0.0.47")
if v <= prev:
    print("Version does not bump above previous 0.0.47", file=sys.stderr); sys.exit(2)
print("Ordering vs previous OK.")
PY

echo
echo "==> Check for other version sources in packaging configs"
rg -nP -C1 '^\s*version\s*=\s*|tool\.setuptools\.dynamic|dynamic\s*=\s*\[.*version.*\]|attr:\s*.*__version__' pyproject.toml setup.cfg setup.py 2>/dev/null || true

echo
echo "==> Scan docs/README for pre-release install hints or stale versions"
rg -nP -C1 '\bpip install cosmograph\b|\b--pre\b|0\.0\.47\b|1\.0\.0b0\b' README.md docs/**/*.md 2>/dev/null || true

Length of output: 925


Confirm version bump and update installation docs

  • version “1.0.0b0” is valid under PEP 440 and correctly orders after 0.0.47.
  • ✅ pyproject.toml is configured with dynamic = ["version"], so the single source of truth is cosmograph/__about__.py.

Action required: update README.md and any docs to include pre-release install instructions. For example, in README.md around line 20:

--- README.md
+++ README.md
@@ -19,3 +19,7
-```sh
-pip install cosmograph
-```
+```sh
+pip install cosmograph
+
+# To install the beta release:
+pip install --pre cosmograph           # latest beta (e.g. 1.0.0b0)
+pip install cosmograph==1.0.0b0        # pin to this exact beta
+```
  • 🔧 Optional: if you’d rather align with more common pre-release numbering, bump to 1.0.0b1.
🤖 Prompt for AI Agents
In cosmograph/__about__.py at line 3 the version is set to "1.0.0b0"; update
README.md (around line 20) and any user-facing docs to include pre-release
install instructions by adding a fenced shell code block showing (1) the normal
pip install command, (2) how to install the beta with pip install --pre
cosmograph, and (3) how to pin to the exact beta with pip install
cosmograph==1.0.0b0; if you prefer a different pre-release tag, optionally
change the version here to "1.0.0b1" and reflect that exact version in the docs.

1 change: 1 addition & 0 deletions cosmograph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from cosmograph.base import cosmo, base_cosmo
from cosmograph.widget import Cosmograph
from cosmograph.config import set_api_key, get_api_key

from importlib.metadata import version, PackageNotFoundError

Expand Down
9 changes: 1 addition & 8 deletions cosmograph/_dev_utils/data/config_prep/parsed_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"optional": true
},
{
"name": "simulationCluster",
"name": "simulationClusterStrength",
"type": "number",
"description": "Cluster coefficient. Default `0.1`.",
"optional": true
Expand Down Expand Up @@ -728,13 +728,6 @@
"optional": true,
"default": "100"
},
{
"name": "showTopLabelsBy",
"type": "string",
"description": "Specify the numeric column that is used to determine the top points that will be sorted by. Works only when `pointLabelBy` is provided.",
"optional": true,
"default": "undefined"
},
{
"name": "pointLabelFn",
"type": "AccessorFn<string>",
Expand Down
Loading