diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29287fb5f..1c266ab55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,7 +64,7 @@ repos: - id: mypy files: ^vizro-core/src/ additional_dependencies: - - pydantic<2.0.0 + - pydantic>=1.10.13, <2 - repo: https://github.com/gitleaks/gitleaks rev: v8.16.4 diff --git a/README.md b/README.md index bd40d433a..f14aae687 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Configuration can be written in multiple formats including **Pydantic models**, Optional high-code extensions allow almost infinite customization in a modular way, combining the best of low-code and high-code - for flexible and scalable, Python enabled data visualization applications -(Visit the ["Why Vizro"](https://vizro.readthedocs.io/en/stable/pages/explanation/why_vizro/) section to see a more detailed explanation of Vizro use cases) +(Visit the ["Why Vizro"](https://vizro.readthedocs.io/en/latest/pages/explanation/why_vizro/) section to see a more detailed explanation of Vizro use cases)
diff --git a/vizro-core/README.md b/vizro-core/README.md index bd40d433a..f14aae687 100644 --- a/vizro-core/README.md +++ b/vizro-core/README.md @@ -76,7 +76,7 @@ Configuration can be written in multiple formats including **Pydantic models**, Optional high-code extensions allow almost infinite customization in a modular way, combining the best of low-code and high-code - for flexible and scalable, Python enabled data visualization applications -(Visit the ["Why Vizro"](https://vizro.readthedocs.io/en/stable/pages/explanation/why_vizro/) section to see a more detailed explanation of Vizro use cases) +(Visit the ["Why Vizro"](https://vizro.readthedocs.io/en/latest/pages/explanation/why_vizro/) section to see a more detailed explanation of Vizro use cases)
diff --git a/vizro-core/changelog.d/20231002_182747_huong_li_nguyen_snyk_fix_45c953e9ecaac62cbefac81184742ed1.md b/vizro-core/changelog.d/20231002_182747_huong_li_nguyen_snyk_fix_45c953e9ecaac62cbefac81184742ed1.md new file mode 100644 index 000000000..e8053167c --- /dev/null +++ b/vizro-core/changelog.d/20231002_182747_huong_li_nguyen_snyk_fix_45c953e9ecaac62cbefac81184742ed1.md @@ -0,0 +1,40 @@ + + + + + + + + +### Security + +- Update pydantic requirement to `pydantic>=1.10.13, <2` due to medium Snyk vulnerability ([#83](https://github.com/mckinsey/vizro/pull/83)) diff --git a/vizro-core/changelog.d/20231003_103941_huong_li_nguyen_end_to_end_use_case_example.md b/vizro-core/changelog.d/20231003_103941_huong_li_nguyen_end_to_end_use_case_example.md new file mode 100644 index 000000000..45c24150e --- /dev/null +++ b/vizro-core/changelog.d/20231003_103941_huong_li_nguyen_end_to_end_use_case_example.md @@ -0,0 +1,41 @@ + + + + +### Added + +- Add comparison table to `Why Vizro` docs page ([#90](https://github.com/mckinsey/vizro/pull/90)) + + + + + diff --git a/vizro-core/changelog.d/20231003_115910_huong_li_nguyen_make_rulers_visible.md b/vizro-core/changelog.d/20231003_115910_huong_li_nguyen_make_rulers_visible.md new file mode 100644 index 000000000..021706e52 --- /dev/null +++ b/vizro-core/changelog.d/20231003_115910_huong_li_nguyen_make_rulers_visible.md @@ -0,0 +1,41 @@ + + + + + + + +### Fixed + +- Fix bug of horizontal rulers not being visible in `Card` ([#91](https://github.com/mckinsey/vizro/pull/91)) + + diff --git a/vizro-core/docs/pages/explanation/why_vizro.md b/vizro-core/docs/pages/explanation/why_vizro.md index c868f1a99..9becbda08 100644 --- a/vizro-core/docs/pages/explanation/why_vizro.md +++ b/vizro-core/docs/pages/explanation/why_vizro.md @@ -1,3 +1,9 @@ +--- +hide: + - navigation + - toc +--- + # Why Vizro In the context of comparison with other visualization packages or business intelligence tools, Vizro combines benefits of the speed and user-friendliness of low-code visual analytics tools with the flexibility and power of high-code tools - whilst providing inbuilt visual design, application architecture and coding standardization which also facilitates scaling and reusability. @@ -12,3 +18,36 @@ The simple and largely declarative configuration language follows a “grammar o Using configuration rather than a GUI to define the output facilitates collaboration during the creation process, and increases reusability and scalability in a Python setting. The largely tech-agnostic configuration driven assembly enables utilizing a range of tools, and an inbuilt validation layer provides meaningful feedback to users about configuration choices, thereby increasing flexibility and ease of use. + +## Python packages and business intelligence (BI) tools + +There are a number of Python packages and BI tools which provide support for visualization applications (such as Streamlit, Plotly/Dash, Tableau and PowerBI). + +Vizro is intended to support several niches between the benefits provided by those tools, rather than being in direct comparison with any single tool. Therefore, direct comparisons are often only partially suitable, given the many features offered across this landscape. + +However, in general, there are several areas of functionality where Vizro can be particularly useful, e.g., in providing a simple configuration to speed up the assembly of components, leveraging inbuilt visual design, application architecture, and coding standards, +along with the ability to scale easily across multiple developers and implementations: + +| Functionality | Benefits | In context of Python packages | In context of BI tools | +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Assembly system** | | Many Python packages still require a moderate understanding of the coding required to assemble higher-level dashboard concepts, which necessitates the creation of “glue code” to combine lower-level components.

Vizro primarily provides a configuration to simplify that assembly of components offered by existing packages (currently leveraging Plotly/Dash), and so occupies a slightly different niche from libraries offering primarily the lower-level components themselves. It also removes the requirement from users to implement certain code standards for the assembled code themselves, and therefore saves time on often time consuming things such as writing unit tests and ensuring linting coverage. | Many BI tools incorporate the assembly of higher-level concepts automatically from GUI (drop-and-drag) interfaces, and occupy a slightly different niche to the configuration driven assembly provided by Vizro. | +| **Inbuilt visual design decisions** | | Many Python packages provide inbuilt color choices, and visual design choices for certain components.

Vizro applies that to a wide range of component combinations and complex user flows, offering a wholistic and comprehensive approach to automatically enable beautiful visual design best practices, whilst allowing customisation and flexibility. | Many BI tools provide inbuilt color choices and visual design choices for certain components.

Vizro provides inbuilt visual design for components in addition to the ability to customise them in a flexible way where needed (for example through CSS), and provides automatic arrangement of components on the screen. | +| **Inbuilt application architecture decisions** | | Many Python packages provide inbuilt application architecture choices for certain functionalities.

Vizro applies that to a wide range of component combinations and complex user flows, offering a wholistic and comprehensive approach to the entire application architecture, whilst allowing customisation and flexibility where relevant. | Many BI tools apply proprietary application architecture by default.

Vizro enables the user to view and understand the application architecture by directly viewing the code. | +| **Declarative configuration, in multiple formats** | | Many Python packages provide a mostly declarative configuration, with limited ability to leverage multiple formats such as Pydantic models and JSON.

Vizro simplifies this approach, and facilitates the extension of the assembly system to enable integration with other tools such as Kedro to programmatically and dynamically generate the relevant dashboard configurations in a streamlined way. | Many BI tools solely use a GUI and/or drag-and-drop interface for defining dashboards, and leverage proprietary configuration formats.

Vizro enables the user to view and understand the configuration by viewing it directly, in addition to being able to edit it directly. | +| **Mostly tech agnostic “grammar of dashboards”** | | Many Python packages provide an effective “grammar of charts” and Python specific declaration.

Vizro provides a “grammar of dashboards” with declaration which is largely tech agnostic and can be extended to non-Python languages. | Many BI tools utilise an implicit internal “grammar of dashboards” which is specific to the proprietary language(s) on with which they are built.

Vizro provides an explicit configuration grammar and allows users to leverage a mostly tech agnostic approach (which can be extended in future). | +| **Inbuilt validation** | | Many Python packages provide individual components or non-Pydantic based models.

Vizro provides the advantages of Pydantic based models for many elements of the configuration process, which leverages the validation and guidance inherent in that process to facilitate implementation by users. | Many BI tools have inbuilt guideline systems to ensure components are combined in a valid way, and provide feedback to the manual user to help guide through that process.

Vizro utilises a flexible system which can be extended to provide feedback to programmatic generation of configuration. | +| **Modularity** | | Many Python packages provide modularity of components such as charts and controls.

Vizro supports modularity of groups of components (such as their implementation together as a dashboard screen), which can be easily transferred between implementations as configuration. | Many BI tools provide extensions and plugins which support modularity of visualizations.

Vizro supports modularity of groups of components (such as their implementation together as a dashboard screen), which can be easily transferred between implementations as configuration. | +| **Flexibility** | | Many Python packages provide some low-code and/or high-code approaches, which offer varying degrees of flexibility.

Vizro provides a wholistic combination of low-code and high-code approaches which support less technical and more technical users individually while allowing them much flexibility in implementation according to their technical level. | Many BI tools offer a no-code (or at least low-code) approach to creating charts and dashboards, along with varying forms of plugins to increase flexibility.

Vizro unlocks Python custom functions to be able to power this user driven flexibility in a technically advanced way, with a high degree of control and visibility over the code, whilst also supporting less technical users through low-code configuration. | +| **Scaling** | | Many Python packages benefit from the ability to propagate updates programmatically, while applying that to “glue code”.

Vizro makes it easy to scale by replicating the relatively small amount of configuration in 1 file between usages, rather than replicating a large amount of code across many files between usages.

Updating configuration programmatically from a central location is often easier than updating code. When sharing between users, it can be easier to inherit and understand configuration than the underlying code. The visual consistency makes it easier to scale within or between projects while maintaining visual coherence. | Many BI tools allow scaling through GUI drag-and-drop interfaces (having some functionality for duplication or propagating changes) for single users.

Vizro makes it easy to leverage tools such as Git to enable almost any number of users to collaborate effectively, therefore allowing the number of developers on a single project to scale easily.

Since updates can be propagated programmatically easily from a central location, it allows scaling across almost any number of related implementations which can be kept up to date and aligned without the need to manually adjust each implementation when updates are required. | +| **Python first** | | Python packages are already Python focussed.

Vizro is no different in this respect. By leveraging Plotly/Dash, Vizro is also able to benefit from the power and flexibility offered by JavaScript via React, whilst still presenting a format that is Python first to the user (by making use of the ability offered by Dash to effectively wrap those components into Python). | Many BI tools do not provide direct or full integration with Python.

Vizro provides a Python first approach which leverages the power and flexibility of Python, and the open source community supporting that wide ranging functionality. | +| **Open source** | | Many Python packages also use an open source licence, and provide ongoing development and maintenance.

Vizro is no different in this respect. | Many BI tools follow a licence fee model and/or charge for ongoing development and maintenance.

Vizro requires no licence fee, and provides ongoing development and support, which helps to remove some barriers to usage. | + +## Cases where alternatives to Vizro are potentially more suitable + +There are a number of cases where alternatives to Vizro may be more suitable, including where: + +- BI tools are already in use, and/or Python developers are not prevalent + +- Development teams already contain designers and JavaScript (or equivalent) engineers able and willing to build bespoke applications (though Vizro can sometimes still be used effectively to rapidly prototype potential solutions) + +- Python developers are already comfortable leveraging other Python packages without the desire to use an assembly system, or do not require inbuilt visual design, application architecture or coding standards, and/or the ability to scale easily across multiple implementations or users diff --git a/vizro-core/docs/stylesheets/extra.css b/vizro-core/docs/stylesheets/extra.css index 74fbd9762..17e3b3ae4 100644 --- a/vizro-core/docs/stylesheets/extra.css +++ b/vizro-core/docs/stylesheets/extra.css @@ -36,3 +36,8 @@ :root > * { --md-code-hl-color: #119bec3e; } + +.md-typeset th, +td:not([class]):not(:last-child) { + border-right: 1px solid lightgrey; +} diff --git a/vizro-core/pyproject.toml b/vizro-core/pyproject.toml index 8f32c3692..7e1a1d929 100644 --- a/vizro-core/pyproject.toml +++ b/vizro-core/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ # 2.11 needed for https://dash.plotly.com/dash-in-jupyter "dash_bootstrap_components", "pandas", - "pydantic<2.0.0", # must be synced with pre-commit mypy hook + "pydantic>=1.10.13, <2", # must be synced with pre-commit mypy hook "dash_daq", "ipython>=8.10.0", # not directly required, pinned by Snyk to avoid a vulnerability: https://app.snyk.io/vuln/SNYK-PYTHON-IPYTHON-3318382 "numpy>=1.22.2", # not directly required, pinned by Snyk to avoid a vulnerability: https://security.snyk.io/vuln/SNYK-PYTHON-NUMPY-2321970 diff --git a/vizro-core/snyk/requirements.txt b/vizro-core/snyk/requirements.txt index 98598233f..982b9abd0 100644 --- a/vizro-core/snyk/requirements.txt +++ b/vizro-core/snyk/requirements.txt @@ -1,7 +1,7 @@ dash>=2.11 dash_bootstrap_components pandas -pydantic<2.0.0 +pydantic>=1.10.13, <2 dash_daq ipython>=8.10.0 numpy>=1.22.2