Skip to content

Commit

Permalink
Proposal / Discussion Logo (#44)
Browse files Browse the repository at this point in the history
* propose a logo.
* add pngs.
* Add favico.
* rename logos.
* Move assets for docs.
* Generate logos with transparent backgrounds.
* Add a changelog entry.
* Bump version.
  • Loading branch information
kellertuer authored Sep 5, 2024
1 parent cedafff commit 4819ffc
Show file tree
Hide file tree
Showing 18 changed files with 222 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this Julia package will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.12] September 5, 2024

### Added

* an individual logo that still resembles the `Manifolds.jl` family but also features a ∂.

## [0.3.11] August 28, 2024

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManifoldDiff"
uuid = "af67fdf4-a580-4b9f-bbec-742ef357defd"
authors = ["Seth Axen <seth.axen@gmail.com>", "Mateusz Baran <mateuszbaran89@gmail.com>", "Ronny Bergmann <manopt@ronnybergmann.net>"]
version = "0.3.11"
version = "0.3.12"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
206 changes: 206 additions & 0 deletions assets/logo_diff.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
using Manifolds, LinearAlgebra, PGFPlotsX, Colors, Contour, Random

#
# Settings
#
dark_mode = true

line_offset_brightness = 0.25
patch_opacity = 1.0
interface_patch_opacity = 0.66
#geo_opacity = dark_mode ? 0.66 : 0.5
geo_opacity = 0.66
geo_line_width = 30
mesh_line_width = 5
mesh_opacity = dark_mode ? 0.5 : 0.7
logo_colors = [(77, 100, 174), (57, 151, 79), (202, 60, 50), (146, 89, 163)] # Julia colors

rgb_logo_colors = map(x -> RGB(x ./ 255...), logo_colors)
rgb_logo_colors_bright =
map(x -> RGB((1 + line_offset_brightness) .* x ./ 255...), logo_colors)
rgb_logo_colors_dark =
map(x -> RGB((1 - line_offset_brightness) .* x ./ 255...), logo_colors)

out_file_prefix = dark_mode ? "logo-diff-dark" : "logo-diff"
out_file_ext = ".svg"

#
# Helping functions
#
polar_to_cart(r, θ) = (r * cos(θ), r * sin(θ))
cart_to_polar(x, y) = (hypot(x, y), atan(y, x))
normal_coord_to_vector(M, x, rθ, B) = get_vector(M, x, collect(polar_to_cart(rθ...)), B)
normal_coord_to_point(M, x, rθ, B) = exp(M, x, normal_coord_to_vector(M, x, rθ, B))

function plot_normal_coord!(ax, M, x, B, rs, θs; ncirc = 9, options = Dict(), kwargs...)
for r in rs[2:(end - 1)]
push!(
ax,
Plot3(
options,
Coordinates(map-> Tuple(normal_coord_to_point(M, x, [r, θ], B)), θs)),
),
)
end
for θ in range(0, 2π; length = ncirc)
push!(
ax,
Plot3(
options,
Coordinates(map(r -> Tuple(normal_coord_to_point(M, x, [r, θ], B)), rs)),
),
)
end
return ax
end

function plot_patch!(ax, M, x, B, r, θs; options = Dict())
push!(
ax,
Plot3(
options,
Coordinates(map-> Tuple(normal_coord_to_point(M, x, [r, θ], B)), θs)),
),
)
return ax
end

function plot_geodesic!(ax, M, x, y; n = 100, options = Dict())
γ = shortest_geodesic(M, x, y)
T = range(0, 1; length = n)
push!(ax, Plot3(options, Coordinates(Tuple.(γ.(T)))))
return ax
end

#
# Prepare document
#
resize!(PGFPlotsX.CUSTOM_PREAMBLE, 0)
push!(PGFPlotsX.CUSTOM_PREAMBLE, raw"\pgfplotsset{scale=6.0}")
push!(PGFPlotsX.CUSTOM_PREAMBLE, raw"\usetikzlibrary{arrows.meta}")
push!(PGFPlotsX.CUSTOM_PREAMBLE, raw"\pgfplotsset{roundcaps/.style={line cap=round}}")
push!(
PGFPlotsX.CUSTOM_PREAMBLE,
raw"\pgfplotsset{meshlinestyle/.style={dash pattern=on 1.8\pgflinewidth off 1.4\pgflinewidth, line cap=round}}",
)
if dark_mode
push!(PGFPlotsX.CUSTOM_PREAMBLE, raw"\pagecolor{black}")
end
S = Sphere(2)

center = normalize([1, 1, 1])
x, y, z = eachrow(Matrix{Float64}(I, 3, 3))
γ1 = shortest_geodesic(S, center, z)
γ2 = shortest_geodesic(S, center, x)
γ3 = shortest_geodesic(S, center, y)
p1 = γ1(1)
p2 = γ2(1)
p3 = γ3(1)

#
# Setup Axes
if dark_mode
tp = @pgf Axis({
axis_lines = "none",
axis_equal,
view = "{135}{35}",
zmin = -0.05,
zmax = 1.0,
xmin = 0.0,
xmax = 1.0,
ymin = 0.0,
ymax = 1.0,
})
else
tp = @pgf Axis({
axis_lines = "none",
axis_equal,
view = "{135}{35}",
zmin = -0.05,
zmax = 1.0,
xmin = 0.0,
xmax = 1.0,
ymin = 0.0,
ymax = 1.0,
})
end
rs = range(0, π / 5; length = 6)
θs = range(0, 2π; length = 100)

#
# Plot manifold patches
patch_colors = rgb_logo_colors[2:end]
patch_colors_line = dark_mode ? rgb_logo_colors_bright[2:end] : rgb_logo_colors_dark[2:end]
base_points = [p1, p2, p3]
basis_vectors = [log(S, p1, p2), log(S, p2, p1), log(S, p3, p1)]
# Patches: 1=red, left, 2=green, top, 3=violet, right
# Interface patches
#=
for i in [2,]
b = base_points[i]
B = DiagonalizingOrthonormalBasis(basis_vectors[i])
basis = get_basis(S, b, B)
optionsP = @pgf {
fill = patch_colors[i],
draw = "none",
opacity = interface_patch_opacity,
}
plot_patch!(tp, S, b, basis, π / 5, θs; options = optionsP)
optionsP =
@pgf {
fill = dark_mode ? "black" : "white",
draw = "none",
opacity = 1.0,
}
plot_patch!(tp, S, b, basis, 0.75 * π / 5, θs; options = optionsP)
end
=#
# Manifold patches
for i in [1, 3] # green
x = base_points[i]
B = DiagonalizingOrthonormalBasis(basis_vectors[i])
basis = get_basis(S, x, B)
optionsP = @pgf {fill = patch_colors[i], draw = "none", opacity = patch_opacity}
plot_patch!(tp, S, x, basis, π / 5, θs; options = optionsP)
optionsL = @pgf {
meshlinestyle,
color = dark_mode ? "white" : "black",
line_width = mesh_line_width,
opacity = mesh_opacity,
}
plot_normal_coord!(tp, S, x, basis, rs, θs; options = optionsL)
end

#
# Plot geodesics
options = @pgf {
opacity = geo_opacity,
"meshlinestyle",
no_markers,
roundcaps,
line_width = geo_line_width,
#color = dark_mode ? "white" : "black",
color = rgb_logo_colors[1],
}
plot_geodesic!(tp, S, base_points[1], base_points[2]; options = options)
plot_geodesic!(tp, S, base_points[1], base_points[3]; options = options)
plot_geodesic!(tp, S, base_points[2], base_points[3]; options = options)
# Text labels

push!(
tp,
raw"\node [scale=60, yshift=.0325cm, xshift=.03cm, color=" *
"$(dark_mode ? "white" : "black")] at ($(p2[1]), $(p2[2]), $(p2[3])) " *
raw"{$\partial$};",
)
#push!(
# tp,
# raw"\node [scale=40, color=" *
# "$(dark_mode ? "white" : "black")] at ($(p3[1]), $(p3[2]), $(p3[3])) " *
# raw"{$\partial$};",
#)
#
# Export Logo.
out_file = "$(out_file_prefix)$(out_file_ext)"
pgfsave(out_file, tp)
pgfsave("$(out_file_prefix).pdf", tp)
Binary file modified docs/src/assets/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/src/assets/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file modified docs/src/assets/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/assets/favicon.ico
Binary file not shown.
Binary file modified docs/src/assets/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/assets/logo-dark_bg.png
Binary file not shown.
Binary file added docs/src/assets/logo-diff-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/logo-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/assets/logo-text-readme.png
Binary file not shown.
Binary file modified docs/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/assets/logo_bg.png
Binary file not shown.
Binary file modified docs/src/assets/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

2 comments on commit 4819ffc

@kellertuer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release Notes:

Added

  • an individual logo that still resembles the Manifolds.jl family but also features a ∂.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/114575

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.12 -m "<description of version>" 4819ffcc67ee8dbd10d535722357e6fa73df0f5b
git push origin v0.3.12

Please sign in to comment.