Skip to content

Commit

Permalink
Revert "feat: Adds ThemeConfig (TypedDict) (#3536)"
Browse files Browse the repository at this point in the history
This reverts commit 712680b.
  • Loading branch information
mattijn authored Sep 22, 2024
1 parent 712680b commit 3d97fae
Show file tree
Hide file tree
Showing 18 changed files with 772 additions and 10,121 deletions.
4 changes: 0 additions & 4 deletions altair/typing/__init__.py → altair/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@
"ChartType",
"EncodeKwds",
"Optional",
"ThemeConfig",
"is_chart_type",
"theme",
]

from altair.typing import theme
from altair.typing.theme import ThemeConfig
from altair.utils.schemapi import Optional
from altair.vegalite.v5.api import ChartType, is_chart_type
from altair.vegalite.v5.schema.channels import (
Expand Down
1 change: 0 additions & 1 deletion altair/typing/theme.py

This file was deleted.

12 changes: 0 additions & 12 deletions altair/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,21 +771,9 @@ def decorate(cb: WrapsFunc[R], /) -> WrappedMethod[T, P, R] | WrappedFunc[P, R]:
return decorate


@overload
def update_nested(
original: t.MutableMapping[Any, Any],
update: t.Mapping[Any, Any],
copy: Literal[False] = ...,
) -> t.MutableMapping[Any, Any]: ...
@overload
def update_nested(
original: t.Mapping[Any, Any],
update: t.Mapping[Any, Any],
copy: Literal[True],
) -> t.MutableMapping[Any, Any]: ...
def update_nested(
original: Any,
update: t.Mapping[Any, Any],
copy: bool = False,
) -> t.MutableMapping[Any, Any]:
"""
Expand Down
9 changes: 4 additions & 5 deletions altair/utils/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
from __future__ import annotations

import sys
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Any, Dict

from altair.utils.plugin_registry import Plugin, PluginRegistry
from altair.vegalite.v5.schema._config import ThemeConfig
from .plugin_registry import Plugin, PluginRegistry

if sys.version_info >= (3, 11):
from typing import LiteralString
Expand All @@ -17,12 +16,12 @@
from altair.utils.plugin_registry import PluginEnabler
from altair.vegalite.v5.theme import AltairThemes, VegaThemes

ThemeType = Plugin[ThemeConfig]
ThemeType = Plugin[Dict[str, Any]]


# HACK: See for `LiteralString` requirement in `name`
# https://github.com/vega/altair/pull/3526#discussion_r1743350127
class ThemeRegistry(PluginRegistry[ThemeType, ThemeConfig]):
class ThemeRegistry(PluginRegistry[ThemeType, Dict[str, Any]]):
def enable(
self, name: LiteralString | AltairThemes | VegaThemes | None = None, **options
) -> PluginEnabler:
Expand Down
Loading

0 comments on commit 3d97fae

Please sign in to comment.