feat: adjust graph visualization parameters and add distinct colors for tag/attachment nodes
This commit is contained in:
@@ -70,10 +70,10 @@ export const DEFAULT_GRAPH_CONFIG: GraphConfig = {
|
||||
lineSizeMultiplier: 1,
|
||||
|
||||
'collapse-forces': false,
|
||||
centerStrength: 0.5,
|
||||
repelStrength: 10,
|
||||
linkStrength: 1,
|
||||
linkDistance: 250,
|
||||
centerStrength: 0.3,
|
||||
repelStrength: 17,
|
||||
linkStrength: 0.5,
|
||||
linkDistance: 200,
|
||||
|
||||
scale: 1,
|
||||
close: false
|
||||
|
||||
@@ -7,7 +7,7 @@ import { computed, Signal } from '@angular/core';
|
||||
import { GraphData, GraphNode, GraphLink, GraphNodeWithVisuals, GroupLegendItem } from './graph-data.types';
|
||||
import { GraphConfig, GraphColorGroup, colorToCss } from './graph-settings.types';
|
||||
import { parseGroupQuery, nodeMatchesQuery } from './group-query.parser';
|
||||
import { DEFAULT_NODE_COLOR } from './graph.utils';
|
||||
import { DEFAULT_NODE_COLOR, DEFAULT_TAG_COLOR, DEFAULT_ATTACHMENT_COLOR } from './graph.utils';
|
||||
|
||||
/**
|
||||
* Apply text search filter to nodes
|
||||
@@ -177,7 +177,14 @@ function applyColorGroups(
|
||||
nodes.forEach(node => degrees.set(node.id, 0));
|
||||
|
||||
return nodes.map(node => {
|
||||
// Set default color based on node type
|
||||
let color = DEFAULT_NODE_COLOR;
|
||||
if (isTagNode(node)) {
|
||||
color = DEFAULT_TAG_COLOR;
|
||||
} else if (isAttachmentNode(node)) {
|
||||
color = DEFAULT_ATTACHMENT_COLOR;
|
||||
}
|
||||
|
||||
let groupIndex: number | undefined = undefined;
|
||||
|
||||
// Find first matching group (first match wins)
|
||||
|
||||
@@ -26,6 +26,16 @@ export const DEFAULT_GROUP_COLORS = [
|
||||
*/
|
||||
export const DEFAULT_NODE_COLOR = '#3B82F6'; // blue-500
|
||||
|
||||
/**
|
||||
* Default tag node color (matching Obsidian's green tags)
|
||||
*/
|
||||
export const DEFAULT_TAG_COLOR = '#98C379'; // green
|
||||
|
||||
/**
|
||||
* Default attachment node color
|
||||
*/
|
||||
export const DEFAULT_ATTACHMENT_COLOR = '#D19A66'; // orange
|
||||
|
||||
/**
|
||||
* Get a pastel color by index (cycles through palette)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user