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

Make node inspector panel toggle button borderless & Document neo4j-arc theming customization #39

Merged
merged 1 commit into from
Nov 26, 2023
Merged
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
1 change: 1 addition & 0 deletions docs/modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@

* xref:neo4j-arc/index.adoc[Neo4J Arc]
** xref:neo4j-arc/i18n.adoc[]
** xref:neo4j-arc/themes.adoc[]
** xref:neo4j-arc/graph-modelling.adoc[]
** xref:neo4j-arc/graph-interactions.adoc[]
41 changes: 41 additions & 0 deletions docs/modules/ROOT/pages/neo4j-arc/themes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:description: This section describes how styling is implemented in neo4j-arc and how to customize it

[[neo4j-arc-themes]]
= Theming

neo4j-arc has full theming support via
https://qubitpi.github.io/styled-components-website/docs/advanced#theming[styled-component] , which provides a theme to
all neo4j-arc components underneath itself via the context API. In the render tree all styled-components will have
access to the provided theme, even when they are multiple levels deep.

Themes are passed down to a component using the `theme` prop

Create a file named *themes.ts*:

[source,typescript]
----
export const theme = {
frameSidebarBackground: "transparent",
};
----

Load the themes:

[source,typescript]
----
import { ThemeProvider } from "styled-components";
import { theme } from "./themes";

export default function MyGraphComponent(): JSX.Element {

const themeData = theme;

return (
<ThemeProvider theme={themeData}>
<GraphVisualizer
...
/>
</ThemeProvider>
);
}
----
2 changes: 2 additions & 0 deletions src/neo4j-arc/graph-visualization/GraphVisualizer/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const StyledNodeInspectorContainer = styled.div<{
export const StyledNodeInspectorTopMenuChevron = styled.button<{
expanded: boolean
}>`
border: none;
outline: none;
background-color: ${props => props.theme.frameSidebarBackground};
cursor: pointer;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j-arc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo4j-devtools-arc",
"version": "0.0.68",
"version": "0.0.69",
"main": "dist/neo4j-arc.js",
"author": "Neo4j Inc.",
"license": "GPL-3.0",
Expand Down