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

Scatter options #458

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions glue_jupyter/bqplot/scatter/layer_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def _update_data(self):
vy = ensure_numerical(self.layer[self.state.vy_att].ravel())

size = 50

# if self.vector_mark.
scale = 1

length = np.sqrt(vx**2 + vy**2)
Expand Down
2 changes: 2 additions & 0 deletions glue_jupyter/common/state_widgets/layer_profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
</div>
</div>
</template>
<script setup>
</script>
14 changes: 14 additions & 0 deletions glue_jupyter/common/state_widgets/layer_scatter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from enum import member

import ipyvuetify as v
import traitlets

Expand Down Expand Up @@ -51,6 +53,9 @@ class ScatterLayerStateWidget(v.VuetifyTemplate):
vy_att_items = traitlets.List().tag(sync=True)
vy_att_selected = traitlets.Int(allow_none=True).tag(sync=True)

vector_origin_items = traitlets.List().tag(sync=True)


def __init__(self, layer_state):
super().__init__()

Expand Down Expand Up @@ -94,3 +99,12 @@ def vue_set_colormap(self, data):
cmap = member[1]
break
self.layer_state.cmap = cmap

def vue_set_vector_origin(self, data):
origin = 'tail'
vector_origins = ['tail', 'middle', 'bottom']
for an_origin in vector_origins:
if data == an_origin:
origin = an_origin
break
self.layer_state.vector_origin = origin
8 changes: 8 additions & 0 deletions glue_jupyter/common/state_widgets/layer_scatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@
<div>
<v-select label="vy" :items="vy_att_items" v-model="vy_att_selected" hide-details />
</div>
<div>
<v-select label="vector origin" :items="vector_origin_items" :value="glue_state.vector_origin" @change="set_vector_origin" hide-details/>
</div>
<div>
<v-subheader class="pl-0 slider-label">vector size</v-subheader>
<glue-throttled-slider wait="300" min="0" max="1" step="0.01" :value.sync="glue_state.vector_scaling"
hide-details />
</div>
</template>
</div>
</template>
Expand Down
Loading