Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump deps #54

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions client/src/ImageSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ function ImageSelector(props) {
}, [actorContext?.labelImageName])

useEffect(() => {
if (name && component >= 0)
updateStateSettings(name, component, send);
}, [name, component])
if (name && component >= 0 && actorContext?.colorRanges) {
const colorRange = actorContext.colorRanges.get(component);
updateStateSettings(name, component, colorRange, send);
}
}, [name, component, actorContext])

const changeImage = async (idx) => {
if (idx < 1)
Expand Down
21 changes: 12 additions & 9 deletions client/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function updateLabelSettings(name, labelImageToggleWeight, send) {
}


export async function updateStateSettings(name, component, send) {
export async function updateStateSettings(name, component, colorRange, send) {
const state = await fetchJSON('../tensorboard_plugin_3d/fetchState');
if (isEmpty(state))
return
Expand Down Expand Up @@ -151,14 +151,6 @@ export async function updateStateSettings(name, component, send) {
type: 'IMAGE_BLEND_MODE_CHANGED',
data: {name, blendMode: state.actorContext.blendMode}
})
send({
type: 'IMAGE_COLOR_RANGE_CHANGED',
data: {
name,
component: component,
range: state.actorContext.colorRange
}
})
send({
type: 'IMAGE_GRADIENT_OPACITY_SCALE_CHANGED',
data: {name, gradientOpacityScale: state.actorContext.gradientOpacityScale}
Expand Down Expand Up @@ -188,4 +180,15 @@ export async function updateStateSettings(name, component, send) {
nodes: state.actorContext.piecewiseFunctions.nodes
}
})
var rangeMin = Math.max(colorRange[0], state.actorContext.colorRange[0]);
var rangeMax = Math.min(colorRange[1], state.actorContext.colorRange[1]);
console.log('range: ', rangeMin, rangeMax);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnmajor debug code

send({
type: 'IMAGE_COLOR_RANGE_CHANGED',
data: {
name,
component: component,
range: [rangeMin, rangeMax]
}
})
}
2 changes: 1 addition & 1 deletion tensorboard_plugin_3d/static/index.html

Large diffs are not rendered by default.