Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions static/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ function editNode(d) {
attachEvents();
nodeMenu.style('display', 'none');
});

// Refresh the Coloris thumbnail
document.querySelector('#edit-node-color').dispatchEvent(new Event('input', { bubbles: true }));
}

function editLink(d) {
Expand Down Expand Up @@ -333,6 +336,7 @@ function editLink(d) {
})[0].strength = this.value;
restart();
});
document.getElementById('edit-link-color').value = d.color || "rgba(0,0,0,0.25)";
linkMenu.select('#edit-link-color')
.property('value', d.color)
.on('input', function() {
Expand Down Expand Up @@ -361,6 +365,9 @@ function editLink(d) {
attachEvents();
linkMenu.style('display', 'none');
});

// Refresh the Coloris thumbnail
document.querySelector('#edit-link-color').dispatchEvent(new Event('input', { bubbles: true }));
}

function addTemplate(template) {
Expand All @@ -380,6 +387,23 @@ function addTemplate(template) {
attachEvents();
}


// Initial Coloris config
Coloris({
theme: 'polaroid',
formatToggle: true
})
// Remember previously used colors
let swatches = new Set(); // Use a Set to prevent duplicates
function addColor(event) {
swatches.add(event.target.value);
Coloris({
swatches: Array.from(swatches)
})
}
document.getElementById('edit-node-color').addEventListener('close', addColor);
document.getElementById('edit-link-color').addEventListener('close', addColor);

panel.on('mousedown', mousedown)
.on('mousemove', mousemove)
.on('mouseup', mouseup);
Expand Down
1 change: 1 addition & 0 deletions static/vendor/coloris.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading