diff --git a/src/Visualisations/CBJuggl.ts b/src/Visualisations/CBJuggl.ts index 850951f3..5f9789c3 100644 --- a/src/Visualisations/CBJuggl.ts +++ b/src/Visualisations/CBJuggl.ts @@ -122,6 +122,7 @@ export function createdJugglCB(plugin: BCPlugin, args: ParsedCodeblock, lines: [string, string][], froms: string[], + source: string, min: number, max: number) { try { @@ -138,6 +139,9 @@ export function createdJugglCB(plugin: BCPlugin, const nodes = lines .filter(([indent, node]) => meetsConditions(indent, node, froms, min, max)) .map(([_, node]) => node + ".md"); + if (min <= 0) { + nodes.push(source + ".md"); + } const bcStore = new BCStore(plugin.mainG, plugin.app.metadataCache, jugglPlugin); const stores: IJugglStores = { @@ -145,6 +149,7 @@ export function createdJugglCB(plugin: BCPlugin, dataStores: [bcStore] } + console.log({args}); const juggl = jugglPlugin.createJuggl(target, args, stores, nodes) plugin.addChild(juggl); juggl.load(); diff --git a/src/constants.ts b/src/constants.ts index 5a013eeb..b34b78f1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -65,25 +65,25 @@ export const CODEBLOCK_FIELDS = [ export const JUGGL_CB_DEFAULTS: IJugglSettings = { autoAddNodes: false, - autoExpand: false, - autoZoom: false, - coreStore: "core", - expandInitial: false, - fdgdLayout: 'cola', - filter: '', - height: '650px', - hoverEdges: false, - layout: 'force-directed', - limit: 250, - mergeEdges: true, - metaKeyHover: true, - mode: 'workspace', - navigator: true, - openWithShift: false, - styleGroups: [], - toolbar: true, - width: '100%', - zoomSpeed: 1, + autoExpand: false, + autoZoom: false, + coreStore: "core", + expandInitial: false, + fdgdLayout: 'd3-force', + filter: '', + height: '750px', + hoverEdges: false, + layout: 'force-directed', + limit: 250, + mergeEdges: true, + metaKeyHover: true, + mode: 'workspace', + navigator: true, + openWithShift: false, + styleGroups: [], + toolbar: true, + width: '100%', + zoomSpeed: 1, }; CODEBLOCK_FIELDS.push(...Object.keys(JUGGL_CB_DEFAULTS)); diff --git a/src/main.ts b/src/main.ts index ce3ad686..449aa2b0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -606,7 +606,7 @@ export default class BCPlugin extends Plugin { el.innerHTML = err; return; } - let min = 1, + let min = 0, max = Infinity; let {depth, dir, from, implied, flat} = parsedSource; if (depth !== undefined) { @@ -673,7 +673,7 @@ export default class BCPlugin extends Plugin { }); break; case "juggl": - createdJugglCB(this, el, parsedSource, lines, froms, min, max); + createdJugglCB(this, el, parsedSource, lines, froms, basename, min, max); break; } } @@ -688,8 +688,16 @@ export default class BCPlugin extends Plugin { ?.split(":")?.[1] ?.trim(); - const results: { [field in CodeblockFields]: string | string[] } = {}; - CODEBLOCK_FIELDS.forEach((field) => (results[field] = getValue(field))); + const results: { [field in CodeblockFields]: string | boolean | string[] } = {}; + CODEBLOCK_FIELDS.forEach((field) => { + results[field] = getValue(field); + if (results[field] === "false") { + results[field] = false; + } + if (results[field] === "true") { + results[field] = true; + } + }); results.field = results.field ? splitAndTrim(results.field as string)