mirror of
https://github.com/simon987/music-graph-ui.git
synced 2025-04-19 10:06:42 +00:00
UI tweaks
This commit is contained in:
parent
2287baf667
commit
4a8a94a6f9
@ -198,7 +198,6 @@ export function MusicGraph(data) {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.newNodes.length > 0) {
|
if (data.newNodes.length > 0) {
|
||||||
this.expandedNodes.add(d.id)
|
this.expandedNodes.add(d.id)
|
||||||
this.graphSize++
|
|
||||||
this.addNodes(data.newNodes, data.relations, d.id)
|
this.addNodes(data.newNodes, data.relations, d.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -317,6 +316,7 @@ export function MusicGraph(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.nodeDbClick = (d) => {
|
this.nodeDbClick = (d) => {
|
||||||
|
this.dismiss()
|
||||||
if (this.svg.classed('menu-mode')) {
|
if (this.svg.classed('menu-mode')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -427,6 +427,9 @@ export function MusicGraph(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nodesToAdd.length > 0) {
|
||||||
|
this.graphSize++
|
||||||
|
}
|
||||||
if (nodesToAdd.length > 100) {
|
if (nodesToAdd.length > 100) {
|
||||||
// That's a lot of nodes, increase spacing
|
// That's a lot of nodes, increase spacing
|
||||||
this.graphSize++
|
this.graphSize++
|
||||||
@ -496,7 +499,7 @@ export function MusicGraph(data) {
|
|||||||
.force('link', d3.forceLink(this.links)
|
.force('link', d3.forceLink(this.links)
|
||||||
.id(d => d.id)
|
.id(d => d.id)
|
||||||
.strength(l => l.weight)
|
.strength(l => l.weight)
|
||||||
.distance(d => (1.12 / d.weight) * 80 * (this.graphSize))
|
.distance(d => (1.12 / d.weight) * 40 * (this.graphSize))
|
||||||
)
|
)
|
||||||
|
|
||||||
this.simulation.alphaTarget(0.03).restart()
|
this.simulation.alphaTarget(0.03).restart()
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
<span>{{artist.name}}<span class="year" v-if="artistInfo.year!==0">[{{artistInfo.year}}]</span></span>
|
<span>{{artist.name}}<span class="year" v-if="artistInfo.year!==0">[{{artistInfo.year}}]</span></span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<a target="_blank" :href="'https://musicbrainz.org/artist/' + artist.mbid">
|
||||||
|
<img width="30" height="30" src="../../static/MB.png"/>
|
||||||
|
</a>
|
||||||
<AlbumCarousel
|
<AlbumCarousel
|
||||||
style="float: right"
|
style="float: right"
|
||||||
:releases="artistInfo.releases"
|
:releases="artistInfo.releases"
|
||||||
|
BIN
music_graph/static/MB.png
Normal file
BIN
music_graph/static/MB.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Loading…
x
Reference in New Issue
Block a user