{"id":20200990,"url":"https://github.com/openclimatefix/ocf-chart-template","last_synced_at":"2025-03-03T08:44:06.162Z","repository":{"id":225137479,"uuid":"765159510","full_name":"openclimatefix/ocf-chart-template","owner":"openclimatefix","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-12T11:23:20.000Z","size":21,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T23:58:19.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openclimatefix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["openclimatefix"],"patreon":null,"open_collective":"openclimatefix","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-02-29T11:49:45.000Z","updated_at":"2024-03-06T17:59:54.000Z","dependencies_parsed_at":"2024-03-07T12:09:34.488Z","dependency_job_id":"6f44d6f9-d988-4a4d-95a8-ea1c15719552","html_url":"https://github.com/openclimatefix/ocf-chart-template","commit_stats":null,"previous_names":["openclimatefix/ocf_chart_template","openclimatefix/ocf-chart-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Focf-chart-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Focf-chart-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Focf-chart-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Focf-chart-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openclimatefix","download_url":"https://codeload.github.com/openclimatefix/ocf-chart-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241637191,"owners_count":19994927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:46:25.903Z","updated_at":"2025-03-03T08:44:06.136Z","avatar_url":"https://github.com/openclimatefix.png","language":"Python","funding_links":["https://github.com/sponsors/openclimatefix","https://opencollective.com/openclimatefix"],"categories":[],"sub_categories":[],"readme":"# OCF Chart Styling Guide\n\nThis repo contains code for creating charts in the general OCF format, using the OCF colour scheme and font.\n\nFor plotly, `pio.templates` is used to set the default chart styling for charts made. This is useful if you are using a notebook to create many charts and want the same base styling applied to each chart without having to rewrite the same styling code each time.\n\n### Using The Style\n\n1. The first way to use this is to copy and paste the code into your notebook/script where you are generating plotly charts.\n2. Alternatively you can create a seperate file called setup_plotly.py with the style put into a function. Then import this function in your notebook/script using something like `from setup_plotly import setup_plotly_template`. Then running `setup_plotly_template()`.\n\n## OCF Colours\n\n- ![#E4E4E4](https://placehold.co/15x15/E4E4E4/E4E4E4.png) `#E4E4E4`\n- ![#FFD053](https://placehold.co/15x15/FFD053/FFD053.png) `#FFD053`\n- ![#FFAC5F](https://placehold.co/15x15/FFAC5F/FFAC5F.png) `#FFAC5F`\n- ![#FF9736](https://placehold.co/15x15/FF9736/FF9736.png) `#FF9736`\n- ![#7BCDF3](https://placehold.co/15x15/7BCDF3/7BCDF3.png) `#7BCDF3`\n- ![#086788](https://placehold.co/15x15/086788/086788.png) `#086788`\n- ![#63BCAF](https://placehold.co/15x15/63BCAF/63BCAF.png) `#63BCAF`\n- ![#4C9A8E](https://placehold.co/15x15/4C9A8E/4C9A8E.png) `#4C9A8E`\n- ![#14120E](https://placehold.co/15x15/14120E/14120E.png) `#14120E`\n\n## OCF Font\n\nThe default font to use is \"Inter\"\n\n## Color Mapping\n\nA color mapping can be useful way to keep track of what each variable each color is associated with. An example of how this might be usesd is:\n\n```\ncolor_mapping = {\n    'PVLive Updated': colors[0],\n    'PEF': colors[1],\n    'PVNet': colors[2],\n    'BMRS': colors[3]\n}\n```\n\nThe associated colors in this mapping can be printed in a notebook using\n\n```\nfrom IPython.display import HTML; HTML(''.join([f\"\u003cdiv style='display:inline-block; margin-right:10px;'\u003e\u003cdiv style='width:20px; height:20px; background:{color}; display:inline-block;'\u003e\u003c/div\u003e {model}\u003c/div\u003e\" for model, color in color_mapping.items()]))\n```\n\nwhich would print the following\n\n![Colour Mapping](colour_mapping_example.png)\n\nWhen creating charts ``color_discrete_map=color_mapping`` can be passed when creating charts to map the colors.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Focf-chart-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclimatefix%2Focf-chart-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Focf-chart-template/lists"}