Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
10af202
Use snake_case helpers for manual category flows
cornhundred Nov 15, 2025
bd622cd
Improve manual categories and enrichment linking
cornhundred Nov 15, 2025
bbbc2a4
Stabilize manual categories and breakdown UI
cornhundred Nov 15, 2025
1efb9cc
Ensure manual categories persist and refresh breakdown
cornhundred Nov 15, 2025
5b06149
Improve manual categories and enrichment UI
cornhundred Nov 16, 2025
e27136a
Seed manual categories and disable cat animations
cornhundred Nov 16, 2025
7cc0a45
Ensure manual category payload refreshes layers
cornhundred Nov 16, 2025
0fc58c7
Fix manual category payload application
cornhundred Nov 16, 2025
a593769
chatgpt fix
cornhundred Nov 16, 2025
58fabe0
indexing fix
cornhundred Nov 16, 2025
92a03b5
Refactor manual categories into obs store
cornhundred Nov 16, 2025
2e7399b
Fix manual traitlet sync
cornhundred Nov 16, 2025
4425c21
Fix manual traitlet syncing
cornhundred Nov 16, 2025
f74aa75
front-end and syncing might be working
cornhundred Nov 17, 2025
ab9df22
working on back-end syncing
cornhundred Nov 17, 2025
debea5f
revert cat_layers.js
cornhundred Nov 17, 2025
4e9d40e
revert cat_data.js
cornhundred Nov 17, 2025
d4a6cc6
reverted notebook
cornhundred Nov 17, 2025
7622e7d
debug
cornhundred Nov 17, 2025
fc6c11f
before simplification
cornhundred Nov 17, 2025
4a62576
simplified sync
cornhundred Nov 17, 2025
b390716
debugging
cornhundred Nov 17, 2025
2ebaf22
debug
cornhundred Nov 17, 2025
eb18a4d
debug - simplify syncing
cornhundred Nov 17, 2025
dab812d
one way sync
cornhundred Nov 17, 2025
4e1b4e1
update
cornhundred Nov 17, 2025
a948bea
debugging traitlets
cornhundred Nov 17, 2025
880d62f
removing category breakdown code for now
cornhundred Nov 17, 2025
6b80b4b
hacking away
cornhundred Nov 17, 2025
2e69c31
debugging
cornhundred Nov 17, 2025
edf55d1
reverted notebook
cornhundred Nov 17, 2025
a9b59cb
removing dataframe traitlet
cornhundred Nov 17, 2025
78f5262
debigging python - starting to work
cornhundred Nov 17, 2025
a195c84
syncing to dataframe working
cornhundred Nov 18, 2025
edd5355
cleaning
cornhundred Nov 18, 2025
96abcd8
cleaning
cornhundred Nov 18, 2025
25a3dc6
cleaning
cornhundred Nov 18, 2025
0d09744
cleaning attr_state.js
cornhundred Nov 18, 2025
dfe371a
removed editable_defs
cornhundred Nov 18, 2025
f225ed3
ruff format
cornhundred Nov 18, 2025
fe8e6d3
ruff formatting
cornhundred Nov 18, 2025
367dac6
reformat
cornhundred Nov 18, 2025
0e3154f
simplified manual_category_store.js
cornhundred Nov 18, 2025
6042483
cleaning and linting
cornhundred Nov 18, 2025
3505118
removed preferred
cornhundred Nov 18, 2025
6a9d9d8
js format;
cornhundred Nov 18, 2025
ae43ed7
format js
cornhundred Nov 18, 2025
00f1ca2
enrich_widget
cornhundred Nov 18, 2025
e3903eb
clean viz init
cornhundred Nov 18, 2025
c861a63
cleaning
cornhundred Nov 18, 2025
e961456
ruff check fix
cornhundred Nov 18, 2025
91c7704
enrich_widget.js
cornhundred Nov 18, 2025
137b883
Update js/matrix/attr_state.js
cornhundred Nov 18, 2025
e1c5e76
0.15.0a1 manual cat
cornhundred Nov 18, 2025
13a35a3
Show manual categories in axis labels (#257)
cornhundred Nov 19, 2025
2d48728
Merge branch 'codex/refactor-manual-categories-to-use-obs_store' of g…
cornhundred Nov 19, 2025
4333e43
0.15.0a2 manual cat display name
cornhundred Nov 19, 2025
6842596
added combined widget.js
cornhundred Nov 19, 2025
4fcfc6b
Add yearbook widget scaffold
cornhundred Nov 22, 2025
159ca4d
removed super
cornhundred Nov 25, 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
188 changes: 94 additions & 94 deletions docs/assets/js/widget.js

Large diffs are not rendered by default.

64 changes: 38 additions & 26 deletions js/deck-gl/matrix/dendro_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,70 @@ const DENDRO_AXES = ['row', 'col'];
const DEFAULT_FILL_COLOR = [0, 0, 0, 90];
const FOCUSED_FILL_COLOR = [0, 0, 0, 180];

const getCurrentFocus = (viz_state) => {
const storeFocus =
const get_current_focus = (viz_state) => {
const store_focus =
viz_state?.obs_store?.focused_dendro &&
typeof viz_state.obs_store.focused_dendro.get === 'function'
? viz_state.obs_store.focused_dendro.get()
: null;

return storeFocus ?? viz_state.dendro?.active_polygon ?? null;
return store_focus ?? viz_state.dendro?.active_polygon ?? null;
};

const applyDendroFocus = (deck_mat, layers_mat, viz_state, focus) => {
const normalizedFocus = focus ? { axis: focus.axis, name: focus.name } : null;
const apply_dendro_focus = (deck_mat, layers_mat, viz_state, focus) => {
const normalized_focus = focus
? { axis: focus.axis, name: focus.name }
: null;

let didUpdate = false;
let did_update = false;

DENDRO_AXES.forEach((targetAxis) => {
if (!viz_state.dendro.polygons[targetAxis]) {
return;
}

const updatedPolygons = viz_state.dendro.polygons[targetAxis].map(
const updated_polygons = viz_state.dendro.polygons[targetAxis].map(
(polygon) => {
const isFocused =
!!normalizedFocus &&
polygon.properties.axis === normalizedFocus.axis &&
polygon.properties.name === normalizedFocus.name;
const is_focused =
!!normalized_focus &&
polygon.properties.axis === normalized_focus.axis &&
polygon.properties.name === normalized_focus.name;

if (polygon.properties.is_focused === isFocused) {
if (polygon.properties.is_focused === is_focused) {
return polygon;
}

didUpdate = true;
did_update = true;

return {
...polygon,
properties: {
...polygon.properties,
is_focused: isFocused,
is_focused,
},
};
}
);

viz_state.dendro.polygons[targetAxis] = updatedPolygons;
viz_state.dendro.polygons[targetAxis] = updated_polygons;

if (layers_mat[`${targetAxis}_dendro_layer`]) {
layers_mat[`${targetAxis}_dendro_layer`] = layers_mat[
`${targetAxis}_dendro_layer`
].clone({
data: updatedPolygons,
data: updated_polygons,
});
}
});

viz_state.dendro.active_polygon = normalizedFocus;
viz_state.dendro.active_polygon = normalized_focus;

if (viz_state.obs_store?.focused_dendro) {
const focusValue = normalizedFocus ? { ...normalizedFocus } : null;
viz_state.obs_store.focused_dendro.set(focusValue);
const focus_value = normalized_focus ? { ...normalized_focus } : null;
viz_state.obs_store.focused_dendro.set(focus_value);
}

if (didUpdate && typeof deck_mat?.setProps === 'function') {
if (did_update && typeof deck_mat?.setProps === 'function') {
deck_mat.setProps({
layers: get_mat_layers_list(layers_mat),
});
Expand Down Expand Up @@ -133,18 +135,18 @@ const focus_dendro_polygon = (
axis,
polygonName
) => {
const previousFocus = getCurrentFocus(viz_state);
const previous_focus = get_current_focus(viz_state);

if (
previousFocus &&
previousFocus.axis === axis &&
previousFocus.name === polygonName
previous_focus &&
previous_focus.axis === axis &&
previous_focus.name === polygonName
) {
applyDendroFocus(deck_mat, layers_mat, viz_state, null);
apply_dendro_focus(deck_mat, layers_mat, viz_state, null);
return;
}

applyDendroFocus(deck_mat, layers_mat, viz_state, {
apply_dendro_focus(deck_mat, layers_mat, viz_state, {
axis,
name: polygonName,
});
Expand Down Expand Up @@ -176,6 +178,16 @@ const dendro_layer_onclick = (event, deck_mat, layers_mat, viz_state, axis) => {
sync_selected_genes(viz_state, event.object.properties.all_names);
}

if (viz_state.attr?.editor?.open) {
viz_state.attr.editor.open({
axis,
selection: event.object.properties.all_names || [],
position: event?.pixel
? { x: event.pixel[0], y: event.pixel[1] }
: undefined,
});
}

if (typeof viz_state.custom_callbacks[`${axis}_dendro`] === 'function') {
viz_state.custom_callbacks[`${axis}_dendro`](
event.object.properties.all_names
Expand Down
4 changes: 2 additions & 2 deletions js/deck-gl/matrix/label_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ini_row_label_layer = (viz_state) => {
id: 'row-label-layer',
data: viz_state.labels.row_label_data,
getPosition: (d, index) => row_label_get_position(d, index, viz_state),
getText: (d) => d.name,
getText: (d) => d.display_name || d.name,
getSize: viz_state.viz.font_size.rows,
getColor: [0, 0, 0],
getAngle: 0,
Expand Down Expand Up @@ -90,7 +90,7 @@ export const ini_col_label_layer = (viz_state) => {
id: 'col-label-layer',
data: viz_state.labels.col_label_data,
getPosition: (d, index) => col_label_get_position(d, index, viz_state),
getText: (d) => d.name,
getText: (d) => d.display_name || d.name,
getSize: viz_state.viz.font_size.cols,
getColor: [0, 0, 0],
getAngle: 45, // Optional: Text angle in degrees
Expand Down
10 changes: 6 additions & 4 deletions js/deck-gl/matrix/matrix_tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export const get_tooltip = (viz_state, params) => {
// Check which layer the tooltip is currently over
if (layer.id === 'row-label-layer') {
return {
html: `Row Label: ${object.name}`,
html: `Row Label: ${object.display_name || object.name}`,
style: { color: 'white' },
};
} else if (layer.id === 'col-label-layer') {
return {
html: `Col Label: ${object.name}`,
html: `Col Label: ${object.display_name || object.name}`,
style: { color: 'white' },
};
} else if (layer.id === 'row-layer') {
Expand Down Expand Up @@ -44,8 +44,10 @@ export const get_tooltip = (viz_state, params) => {
} else if (layer.id === 'mat-layer') {
// Display the default tooltip for other layers

const row_name = viz_state.labels.row_label_data[object.row].name;
const col_name = viz_state.labels.col_label_data[object.col].name;
const row_entry = viz_state.labels.row_label_data[object.row];
const col_entry = viz_state.labels.col_label_data[object.col];
const row_name = row_entry?.display_name || row_entry?.name;
const col_name = col_entry?.display_name || col_entry?.name;

return {
html: `Row: ${row_name} <br> Column: ${col_name} <br> Value: ${object.value.toFixed(2)}`,
Expand Down
Loading