Skip to content
34 changes: 0 additions & 34 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -1,34 +0,0 @@
sandbox_mode = "workspace-write"
default_permissions = "workspace_no_env"

[permissions.workspace_no_env.filesystem]
":minimal" = "read"
glob_scan_max_depth = 5

[permissions.workspace_no_env.filesystem.":workspace_roots"]
"." = "write"

# repo直下
".env" = "deny"
".env.*" = "deny"

# サブディレクトリ配下
"**/.env" = "deny"
"**/.env.*" = "deny"
"**/*.env" = "deny"

[permissions.workspace_no_env.network]
enabled = true

[permissions.workspace_no_env.network.domains]
"kurusugawa.jp" = "allow"
"api.openai.com" = "allow"
"registry.npmjs.org" = "allow"
"pypi.org" = "allow"
"files.pythonhosted.org" = "allow"
"*.github.com" = "allow"
"objects.githubusercontent.com" = "allow"

[shell_environment_policy]
inherit = "core"
set = { UV_CACHE_DIR = "/tmp/uv-cache" }
8 changes: 8 additions & 0 deletions annofabcli/statistics/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def __init__(

self.text_glyphs: dict[str, GlyphRenderer] = {}
"""key:user_id, value: 散布図に表示している名前のGlyph"""
self._plotted_users: dict[str, str] = {}
"""key:user_id, value: 散布図に表示しているユーザー名"""
self._scatter_glyphs: dict[str, GlyphRenderer] = {}
"""key:biography, value: 散布図に表示している円形のGlyph"""

Expand Down Expand Up @@ -148,6 +150,7 @@ def plot_scatter(
# 1点ごとに`text`で名前を表示している理由:
# `add_multi_choice_widget_for_searching_user`関数で追加したMultiChoice Widgetで、名前の表示スタイルを変更するため
for x, y, username, user_id in zip(source.data[x_column_name], source.data[y_column_name], source.data[username_column_name], source.data[user_id_column_name], strict=False):
self._plotted_users[user_id] = username
self.text_glyphs[user_id] = self.figure.text(
x=x,
y=y,
Expand Down Expand Up @@ -202,6 +205,7 @@ def plot_bubble(
# 1点ごとに`text`で名前を表示している理由:
# `add_multi_choice_widget_for_searching_user`関数で追加したMultiChoice Widgetで、名前の表示スタイルを変更するため
for x, y, username, user_id in zip(source.data[x_column_name], source.data[y_column_name], source.data[username_column_name], source.data[user_id_column_name], strict=False):
self._plotted_users[user_id] = username
self.text_glyphs[user_id] = self.figure.text(
x=x,
y=y,
Expand Down Expand Up @@ -231,6 +235,10 @@ def process_after_adding_glyphs(self) -> None:
if self._hover_tool is not None and self._scatter_glyphs is not None:
self._hover_tool.renderers = list(self._scatter_glyphs.values())

def get_plotted_users(self) -> list[tuple[str, str]]:
"""散布図に表示しているユーザーのリストを返します。"""
return list(self._plotted_users.items())

def configure_legend(self) -> None:
"""
凡例を設定します。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def _create_productivity_element_list(
quartile = self._get_quartile_value(df[(f"{worktime_type.value}_worktime_minute/{production_volume_column}", phase)])
scatter_obj.plot_quartile_line(quartile, dimension="width")

scatter_obj.add_multi_choice_widget_for_searching_user(list(zip(df[("user_id", "")], df[("username", "")], strict=False)))
scatter_obj.add_multi_choice_widget_for_searching_user(scatter_obj.get_plotted_users())
scatter_obj.process_after_adding_glyphs()

div_element = self._create_div_element()
Expand Down Expand Up @@ -1144,7 +1144,7 @@ def create_scatter_obj(title: str, x_axis_label: str, y_axis_label: str) -> Scat
scatter_obj.plot_quartile_line(quartile, dimension="width")

for scatter_obj in scatter_obj_list:
scatter_obj.add_multi_choice_widget_for_searching_user(list(zip(df[("user_id", "")], df[("username", "")], strict=False)))
scatter_obj.add_multi_choice_widget_for_searching_user(scatter_obj.get_plotted_users())
scatter_obj.process_after_adding_glyphs()

div_element = self._create_div_element()
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def plot_average_and_quartile_line() -> None:
plot_average_and_quartile_line()

for scatter_obj in scatter_obj_list:
scatter_obj.add_multi_choice_widget_for_searching_user(list(zip(df[("user_id", "")], df[("username", "")], strict=False)))
scatter_obj.add_multi_choice_widget_for_searching_user(scatter_obj.get_plotted_users())
scatter_obj.process_after_adding_glyphs()

div_element = self._create_div_element()
Expand Down
Loading