Skip to content

How to set minimap node color for a custom node without background color #432

Answered by bcakmakoglu
lucasoares asked this question in Q&A
Discussion options

You must be logged in to vote

You don't need to pass custom minimap nodes to achieve that effect :)

The minimap accepts a nodeColor prop which you can use the color the background of each minimap node.
There's also a nodeStrokeColor prop (for the border of each minimap node) and nodeStrokeWidth (the border width basically).

So an example would look like this

<script lang="ts" setup>
...

// this is a minimap node function, you can use this sort of function for nodeColor, nodeStrokeColor and nodeClassName
const nodeColor: MiniMapNodeFunc = (node) => {
  switch (node.id) {
    case '1':
      return 'green'
    case '2':
      return 'red'
    case '3':
      return 'blue'
    case '4':
      return `rgb(${color.value.red

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bcakmakoglu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants