Skip to content

Commit

Permalink
Merge pull request #42 from MakieOrg/aog_section
Browse files Browse the repository at this point in the history
from branch
  • Loading branch information
lazarusA authored Jan 6, 2024
2 parents d48452f + e60b14a commit 41b498b
Show file tree
Hide file tree
Showing 33 changed files with 2,654 additions and 225 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
# using the `master` branch as the default branch.
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
with:
node-version: 18
cache: npm # or pnpm / yarn
cache-dependency-path: 'package.json' # this should be a package-lock.json file
cache-dependency-path: 'package-lock.json' # this should be a package-lock.json file
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ docs/src/examples

.cache
dev
test_record
test_record
node_modules
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,57 @@

[beautiful.makie.org](https://beautiful.makie.org)

Web page with basic examples showing how to use makie in julia
Web page with basic examples showing how to use makie in julia.

Some guidance on how to dev this locally:

```shell
npm install -D vitest
```
or
```shell
npm i
```
if a package*.json file is provided. Also you will need vitepress

```shell
npm add -D vitepress
```

## Generating files
> For this you should have [julia](https://julialang.org/downloads/) installed in your computer.
Then `cd` into the `docs` folder and `activate` and `instantiate` the `env` there:

```julia
julia>]
```
```julia
pkg> activate .
```
```julia
pkg> instantiate
```
then do

```julia
julia> include("gen_mds.jl")
```
and
```julia
julia> include("make.jl")
```
these step will generate all files needed in order to build the site, you could serve/build/preview it by doing

```shell
BeautifualMakie $ npm run docs:dev
```

```shell
BeautifualMakie $ npm run docs:build
```
and

```shell
BeautifualMakie $ npm run docs:preview
```
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67"
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
AssociatedLegendrePolynomials = "2119f1ac-fb78-50f5-8cc0-dda848ebdb19"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Expand All @@ -8,13 +9,15 @@ ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
Expand All @@ -33,6 +36,8 @@ PalmerPenguins = "8b842266-38fa-440a-9b57-31493939ab85"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RasterDataSources = "3cb90ccd-e1b6-4867-9617-4276c8b2ca36"
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Expand Down
70 changes: 10 additions & 60 deletions docs/gen_mds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OUTPUT = joinpath(@__DIR__, "src", "examples")

folders = readdir(joinpath(@__DIR__, "..", "examples"))
setdiff!(folders, [".DS_Store"])
setdiff!(folders, ["geo", "rpr", "aog", "datavis"])
setdiff!(folders, ["rpr"])

function get_files(folders)
srcsfiles = []
Expand All @@ -17,11 +17,15 @@ function get_files(folders)
setdiff!(names, [".DS_Store",
"world_energy.jl",
"gapminder.jl",
"vertical_feature_mask.jl",
"submarine_cables.jl",
"timeseries_proj.jl",
"earthquakes_proj.jl",
"gott_azimuthal.jl",
"rasters.jl",
"density_ridges.jl",
"penguins.jl",
"penguins3d.jl",
"penguinsAoG.jl",
"penguinsBoxes.jl",
"penguinsViolins.jl",
"submarine_cables.jl",
])

fpaths = "$(f)/" .* names
Expand All @@ -39,58 +43,4 @@ srcsfiles = get_files(src_folders)
for p in srcsfiles
Literate.markdown(get_example_path(p), joinpath(OUTPUT, dirname(p));
documenter=true, credit=false)
end

# using Pkg

# ENV["MODERNGL_DEBUGGING"] = "true"; Pkg.build("ModernGL")
# using Literate, ProgressMeter
# using GLMakie
# if !GLMakie.ModernGL.enable_opengl_debugging
# # can't error, since we can't enable debugging for users
# @warn("TESTING WITHOUT OPENGL DEBUGGING")
# end
# get_example_path(p) = joinpath(@__DIR__, "examples", p)
# OUTPUT = joinpath(@__DIR__, "src", "examples", "generated")

# folders = readdir(joinpath(@__DIR__, "examples"))
# setdiff!(folders, [".DS_Store"])
# #setdiff!(folders, ["bars"])
# setdiff!(folders, ["cheat_sheets", "aog"])

# #folders = ["aog"]

# function get_files()
# srcsfiles = []
# for f in folders
# names = readdir(joinpath(@__DIR__, "examples", f))
# setdiff!(names, [".DS_Store", "density_ridges.jl",
# "world_energy.jl", "gapminder.jl",
# "vertical_feature_mask.jl",
# "submarine_cables.jl",
# "timeseries_proj.jl",
# "boxplots_collection.jl",
# "collection_violins.jl",
# "earthquakes_proj.jl",
# "rasters.jl",
# "makie_contributors.jl"])

# fpaths = "$(f)/" .* names
# srcsfiles = vcat(srcsfiles, fpaths...)
# end
# return srcsfiles
# end

# srcsfiles = get_files()

# mkdir("test-record")
# cd("test-record")
# using Makie
# @showprogress for p in srcsfiles
# path = joinpath(@__DIR__, "examples", p)
# println(p)
# fig = Base.evalfile(path)
# fig = Makie.current_figure()
# name = splitext(basename(p))[1]
# save(name * ".png", fig)
# end
end
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include("theme_light_dark.jl")
set_theme!(merge(theme_latexfonts(), theme_light_dark()))

# ENV["RASTERDATASOURCES_PATH"] = "/Users/lalonso/data/"

makedocs(; sitename="BeautifulMakie", authors="Lazaro Alonso",
clean=true,
checkdocs=:all,
Expand Down
63 changes: 57 additions & 6 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import { defineConfig } from 'vitepress'
// We can use mergeConfig method from vite or vitest/config entries to merge Vitepress config with Vitest config:
import { mergeConfig } from 'vite';
import { defineConfig as defineViteConfig} from 'vitepress';
import { defineConfig as defineVitestConfig } from 'vitest/config';
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'

// https://vitepress.dev/reference/site-config
export default defineConfig({
const vitestConfig = defineVitestConfig({
build: {
chunkSizeWarningLimit:500,
rollupOptions: {
output:{
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
}
}
},
});
const viteConfig = defineViteConfig({
base: '/',
title: "Beautiful Makie",
description: "A gallery collection",
Expand Down Expand Up @@ -63,8 +80,8 @@ export default defineConfig({
{ text: 'Themes', link: '/examples/themes/black_epicycloid' },
{ text: 'Animations', link: '/examples/animations/scatter_size' },
{ text: 'Dashboards', link: '/examples/dashboards/tesseral_spherical_harmonics' },
{ text: 'Data Visualization', link: '' },
{ text: 'Geo', link: '' },
{ text: 'Data Visualization', link: '/examples/datavis/earthquakes' },
{ text: 'Geo', link: '/examples/geo/projections' },
{ text: 'Algebra of Graphics', link: '/examples/aog/penguins3d' },
{ text: 'Raytracing', link: '' }
]},
Expand Down Expand Up @@ -416,7 +433,39 @@ export default defineConfig({
],
},
],

'/examples/geo/': [
{
text: 'Geo',
collapsed: true,
items: [
{ text: 'blue_marble', link: '/examples/geo/blue_marble' },
{ text: 'coastlines', link: '/examples/geo/coastlines' },
{ text: 'donut_earth_sun', link: '/examples/geo/donut_earth_sun' },
{ text: 'moon', link: '/examples/geo/moon' },
{ text: 'projections', link: '/examples/geo/projections' },
{ text: 'Rasters animation', link: '/examples/geo/rasters' },
{ text: 'us_states', link: '/examples/geo/us_states' },
{ text: 'vertical_feature_mask', link: '/examples/geo/vertical_feature_mask' },
],
},
],
'/examples/datavis/': [
{
text: 'Data Visualization',
collapsed: true,
items: [
{ text: 'astronauts', link: '/examples/datavis/astronauts' },
{ text: 'earthquakes_proj', link: '/examples/datavis/earthquakes_proj' },
{ text: 'earthquakes', link: '/examples/datavis/earthquakes' },
{ text: 'eigenvals_densities', link: '/examples/datavis/eigenvals_densities' },
{ text: 'eigenvals_evolution', link: '/examples/datavis/eigenvals_evolution' },
{ text: 'fractals', link: '/examples/datavis/fractals' },
{ text: 'leos', link: '/examples/datavis/leos' },
{ text: 'multipleTitles', link: '/examples/datavis/multipleTitles' },
{ text: 'strange_attractors', link: '/examples/datavis/strange_attractors' },
],
},
],
},
socialLinks: [
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/lazaro-alonso/' },
Expand All @@ -429,4 +478,6 @@ export default defineConfig({
copyright: '© Copyright 2023 <strong>Lazaro Alonso</strong>'
}
}
})
})

export default mergeConfig(viteConfig, vitestConfig);
4 changes: 2 additions & 2 deletions examples/aog/density_ridges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AlgebraOfGraphics as AoG
GLMakie.activate!()

function getPenguins()
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
## ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
return penguins
end
Expand All @@ -29,7 +29,7 @@ save("densityridges1.png", current_figure()); # hide
# ![](densityridges1.png)

p_len = data(penguins)
#p_len = AoG.density()
## p_len = AoG.density()
p_len *= mapping(:flipper_length_mm, color=:species)
p_len *= visual(AoG.Density, direction=:y, offset = 1.0,
alpha = 0.2, strokewidth = 1.5, strokecolor = :grey20)
Expand Down
2 changes: 1 addition & 1 deletion examples/aog/penguins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using GLM: lm, @formula, predict
CairoMakie.activate!(type = "svg") #hide

function getPenguins()
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
## ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
return penguins
end
Expand Down
2 changes: 1 addition & 1 deletion examples/aog/penguins3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using GLMakie
GLMakie.activate!()

function getPenguins()
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
## ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
return penguins
end
Expand Down
2 changes: 1 addition & 1 deletion examples/aog/penguinsAoG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using AlgebraOfGraphics
GLMakie.activate!()

function getPenguins()
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
## ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
return penguins
end
Expand Down
2 changes: 1 addition & 1 deletion examples/aog/penguinsBoxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CairoMakie.activate!(type = "svg") #hide


function getPenguins()
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
## ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
return penguins
end
Expand Down
Loading

0 comments on commit 41b498b

Please sign in to comment.