Skip to content

Commit

Permalink
Merge PR #17 from raj978/main
Browse files Browse the repository at this point in the history
Add Dark and Light "Futuristic" Themes
  • Loading branch information
GeorgeBerdovskiy authored Feb 24, 2024
2 parents b3be8e0 + 28412b9 commit b287b67
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/purechart/chart_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def lollipop_chart(data, configuration = { axes: { horizontal: "Value" } }, path

default_config_hash = YAML.load(File.read(default_config_path))
user_config_hash = {}

if path == "professional_light"
# TODO - Instead of loading our own by default, try/catch to see if they defined their own
# style using the same name
Expand All @@ -15,6 +15,12 @@ def lollipop_chart(data, configuration = { axes: { horizontal: "Value" } }, path
elsif path == "professional_dark"
style_config_path = File.join( File.dirname(__FILE__), 'styles/professional_dark.yml' )
default_config_hash = YAML.load(File.read(style_config_path))
elsif path == "futuristic_light"
style_config_path = File.join( File.dirname(__FILE__), 'styles/futuristic_light.yml' )
default_config_hash = YAML.load(File.read(style_config_path))
elsif path == "futuristic_dark"
style_config_path = File.join( File.dirname(__FILE__), 'styles/futuristic_dark.yml' )
default_config_hash = YAML.load(File.read(style_config_path))
elsif path != ""
# TODO - Implement better logic
if File.file?("app/purechart/" + path + ".yml")
Expand Down
28 changes: 28 additions & 0 deletions lib/purechart/styles/futuristic_dark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title:
font: Futura
weight: 700
color: "#FFFFFF"
labels:
font: Futura
weight: 700
color: "#FFFFFF"
ticks:
font: Futura
weight: 400
color: "#FFFFFF"
axes:
style: "2px solid #FFFFFF"
gridlines:
style: "2px dashed #FFFFFF33"
colors:
green: '#90EE90'
red: '#FF6347'
orange: '#FFA500'
blue: '#1E90FF'
yellow: '#FFFF00'
purple: '#BA55D3'
brown: '#A52A2A'
grey: '#808080'
...

27 changes: 27 additions & 0 deletions lib/purechart/styles/futuristic_light.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title:
font: Futura
weight: 700
color: "#000000"
labels:
font: Futura
weight: 700
color: "#000000"
ticks:
font: Futura
weight: 400
color: "#000000"
axes:
style: "2px solid #000000"
gridlines:
style: "2px dashed #00000033"
colors:
green: '#478279'
red: '#e2458c'
orange: '#f7931b'
blue: '#00c2ff'
yellow: '#ffc107'
purple: '#943ca3'
brown: '#8a5b3f'
grey: '#808080'
...

0 comments on commit b287b67

Please sign in to comment.