Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
/orcaPublic archive
Merged
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
2 changes: 1 addition & 1 deletion src/component/plotly-graph/render.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ function render (info, opts, sendToMain) {
const encoded = info.encoded

const config = Object.assign({
mapboxAccessToken: opts.mapboxAccessToken || '',
mapboxAccessToken: opts.mapboxAccessToken || null,
plotGlPixelRatio: opts.plotGlPixelRatio || cst.plotGlPixelRatio
}, figure.config)

Expand Down
22 changes: 22 additions & 0 deletions test/unit/plotly-graph_test.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -913,5 +913,27 @@ tap.test('render:', t => {
})
})

t.test('should pass mapboxAccessToken as config option (string case)', t => {
mock130()

const token = '312dsadsa1321'

fn({}, { mapboxAccessToken: token }, () => {
t.ok(Plotly.toImage.calledOnce)
t.equal(Plotly.toImage.args[0][0].config.mapboxAccessToken, token)
t.end()
})
})

t.test('should pass mapboxAccessToken as config option (empty case)', t => {
mock130()

fn({}, { mapboxAccessToken: '' }, () => {
t.ok(Plotly.toImage.calledOnce)
t.equal(Plotly.toImage.args[0][0].config.mapboxAccessToken, null)
t.end()
})
})

t.end()
})