Skip to content

Commit 5124085

Browse files
committed
fix defaults
1 parent bb62821 commit 5124085

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

ext/QuanticaMakieExt/docstrings.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ inter-site links, and a representation of contacts.
8282
- `hopcolor = missing`: color of hops, as a index in `hopcolormap`, a named color, a `Makie.Colorant`, a collection of either, or as a hop shader (see below). If `missing`, cycle through `sitecolormap`. If a collection, cycle through that.
8383
- `hopcolormap = :Spectral_9`: colormap to use for `hopcolor` (see options in https://tinyurl.com/cschemes, or create your own with ColorSchemes.jl)
8484
- `hopopacity = missing`: opacity of hops, as a real between 0 and 1, or as a hop shader (see below)
85-
- `hopradius = 0.1`: if `flat = false` radius of hops as a real number, or as a hop shader (see below)
85+
- `hopradius = 0.03`: if `flat = false` radius of hops as a real number, or as a hop shader (see below)
8686
- `hoppixels = 6`: if `flat = true` fixed hop linewidth in pixels, or maximum pixel linewidth if `hopradius` is a shader.
87-
- `minmaxhopradius = (0, 0.2)`: if `hopdradius` is a shader, minimum and maximum hop radius.
87+
- `minmaxhopradius = (0, 0.1)`: if `hopdradius` is a shader, minimum and maximum hop radius.
8888
- `hopdarken = 0.85`: darkening factor for hops
8989
- `neighborscaling = true`: if `true`, all spatial scales above are multiplied by the nearest-neighbor distance of the lattice before plotting.
9090
- `selector = missing`: an optional `siteselector(; sites...)` to filter which sites are shown (see `siteselector`)

ext/QuanticaMakieExt/plotlattice.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
sitecolormap = :Spectral_9,
2424
hopcolor = missing, # accepts ((i,j), (r,dr)) -> float, IndexableObservable
2525
hopopacity = missing, # accepts ((i,j), (r,dr)) -> float, IndexableObservable
26-
minmaxhopradius = (0.0, 0.2),# when hopradius is a function, range of values to scale to
27-
hopradius = 0.1, # accepts ((i,j), (r,dr)) -> float, IndexableObservable
26+
minmaxhopradius = (0.0, 0.1),# when hopradius is a function, range of values to scale to
27+
hopradius = 0.03, # accepts ((i,j), (r,dr)) -> float, IndexableObservable
2828
hopdarken = 0.85,
2929
hopcolormap = :Spectral_9,
3030
hoppixels = 2,
@@ -334,11 +334,12 @@ primitive_radius(normr, radius, (minr, maxr)) = minr + (maxr - minr) * normr
334334

335335
## retract_hops! ##
336336

337-
function retract_hops!(hp::HoppingPrimitives, sp::SitePrimitives)
337+
function retract_hops!(hp::HoppingPrimitives, sp::SitePrimitives, plot)
338338
for n in eachindex(hp.vectors)
339339
r, dr = hp.centers[n], hp.vectors[n]
340340
_, j = hp.indices[n]
341341
R, Rj = hp.radii.data[n], sp.radii.data[j]
342+
plot[:flat][] && (R = zero(R))
342343
dl = (Rj>R ? sqrt(Rj^2-R^2) : 0.0) * dr/norm(dr)
343344
dr´ = dr - dl
344345
= r + 0.5 * dl
@@ -490,10 +491,8 @@ function Makie.plot!(plot::PlotLattice{Tuple{H,S,S´}}) where {H<:Hamiltonian,S<
490491
else
491492
joint_colors_radii_update!(hp, hp´, plot)
492493
end
493-
if !plot[:flat][]
494-
retract_hops!(hp, sp)
495-
retract_hops!(hp´, sp)
496-
end
494+
retract_hops!(hp, sp, plot)
495+
retract_hops!(hp´, sp, plot)
497496
end
498497

499498
# plot hops
@@ -714,8 +713,9 @@ function plotbravais!(plot::PlotLattice, lat::Lattice{<:Any,E,L}, latslice) wher
714713
vtot = sum(vs)
715714
r0 = Point{E,Float32}(Quantica.mean(Quantica.sites(lat))) - 0.5 * vtot
716715
if !ishidden(:axes, plot)
716+
markerscale = maximum(norm, vs) * 0.2
717717
for (v, color) in zip(vs, (:red, :green, :blue))
718-
arrows3d!(plot, [r0], [v]; color, inspectable = false, markerscale = 1)
718+
arrows3d!(plot, [r0], [v]; color, inspectable = false, markerscale)
719719
end
720720
end
721721
if !ishidden((:cell, :cells), plot) && L > 1

0 commit comments

Comments
 (0)