Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: separate active and inactive streams visually #560

Merged
merged 4 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion shell/generate-svg-panoply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ set -euo pipefail
./shell/generate-svg.sh 4999 "Streaming" "999.45K" 10000

./shell/generate-svg.sh 10000 "Settled" "1" 892
./shell/generate-svg.sh 10000 "Settled" "14.94K" 892
./shell/generate-svg.sh 10000 "Settled" "14.94K" 11
./shell/generate-svg.sh 10000 "Settled" "733" 3402
./shell/generate-svg.sh 10000 "Settled" "645.01M" 3402
./shell/generate-svg.sh 10000 "Settled" "990.12B" 6503

./shell/generate-svg.sh 10000 "Depleted" "1" 892
./shell/generate-svg.sh 10000 "Depleted" "79.1B" 892
./shell/generate-svg.sh 4972 "Depleted" "29" 3402
./shell/generate-svg.sh 744 "Depleted" "343.01K" 3402
./shell/generate-svg.sh 10000 "Depleted" "84.1M" 6503
11 changes: 7 additions & 4 deletions src/libraries/SVGElements.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ library SVGElements {
string internal constant HOURGLASS_STROKE =
'<g fill="none" stroke="url(#HourglassStroke)" stroke-linecap="round" stroke-miterlimit="10" stroke-width="4"><path d="m565.641,107.28c0,9.537-5.56,18.629-15.676,26.973h-.023c-9.204,7.596-22.194,14.562-38.197,20.592-39.504,14.936-97.325,24.355-161.733,24.355-90.48,0-167.948-18.582-199.953-44.948h-.023c-10.115-8.344-15.676-17.437-15.676-26.973,0-39.735,96.554-71.921,215.652-71.921s215.629,32.185,215.629,71.921Z"/><path d="m134.36,161.203c0,39.735,96.554,71.921,215.652,71.921s215.629-32.186,215.629-71.921"/><line x1="134.36" y1="161.203" x2="134.36" y2="107.28"/><line x1="565.64" y1="161.203" x2="565.64" y2="107.28"/><line x1="184.584" y1="206.823" x2="184.585" y2="537.579"/><line x1="218.181" y1="218.118" x2="218.181" y2="562.537"/><line x1="481.818" y1="218.142" x2="481.819" y2="562.428"/><line x1="515.415" y1="207.352" x2="515.416" y2="537.579"/><path d="m184.58,537.58c0,5.45,4.27,10.65,12.03,15.42h.02c5.51,3.39,12.79,6.55,21.55,9.42,30.21,9.9,78.02,16.28,131.83,16.28,49.41,0,93.76-5.38,124.06-13.92,2.7-.76,5.29-1.54,7.75-2.35,8.77-2.87,16.05-6.04,21.56-9.43h0c7.76-4.77,12.04-9.97,12.04-15.42"/><path d="m184.582,492.656c-31.354,12.485-50.223,28.58-50.223,46.142,0,9.536,5.564,18.627,15.677,26.969h.022c8.503,7.005,20.213,13.463,34.524,19.159,9.999,3.991,21.269,7.609,33.597,10.788,36.45,9.407,82.181,15.002,131.835,15.002s95.363-5.595,131.807-15.002c10.847-2.79,20.867-5.926,29.924-9.349,1.244-.467,2.473-.942,3.673-1.424,14.326-5.696,26.035-12.161,34.524-19.173h.022c10.114-8.342,15.677-17.433,15.677-26.969,0-17.562-18.869-33.665-50.223-46.15"/><path d="m134.36,592.72c0,39.735,96.554,71.921,215.652,71.921s215.629-32.186,215.629-71.921"/><line x1="134.36" y1="592.72" x2="134.36" y2="538.797"/><line x1="565.64" y1="592.72" x2="565.64" y2="538.797"/><polyline points="481.822 481.901 481.798 481.877 481.775 481.854 350.015 350.026 218.185 218.129"/><polyline points="218.185 481.901 218.231 481.854 350.015 350.026 481.822 218.152"/></g>';

string internal constant HOURGLASS_LOWER_BULB =
string internal constant HOURGLASS_LOWER_BULB_LARGE =
'<path d="m481.46,481.54v81.01c-2.35.77-4.82,1.51-7.39,2.23-30.3,8.54-74.65,13.92-124.06,13.92-53.6,0-101.24-6.33-131.47-16.16v-81l46.3-46.31h170.33l46.29,46.31Z" fill="url(#SandBottom)"/><path d="m435.17,435.23c0,1.17-.46,2.32-1.33,3.44-7.11,9.08-41.93,15.98-83.81,15.98s-76.7-6.9-83.82-15.98c-.87-1.12-1.33-2.27-1.33-3.44v-.04l8.34-8.35.01-.01c13.72-6.51,42.95-11.02,76.8-11.02s62.97,4.49,76.72,11l8.42,8.42Z" fill="url(#SandTop)"/>';

string internal constant HOURGLASS_LOWER_BULB_SMALL =
'<path d="m481.46,504.101v58.449c-2.35.77-4.82,1.51-7.39,2.23-30.3,8.54-74.65,13.92-124.06,13.92-53.6,0-101.24-6.33-131.47-16.16v-58.439h262.92Z" fill="url(#SandBottom)"/><ellipse cx="350" cy="504.101" rx="131.462" ry="28.108" fill="url(#SandTop)"/>';

string internal constant HOURGLASS_UPPER_BULB =
'<polygon points="350 350.026 415.03 284.978 285 284.978 350 350.026" fill="url(#SandBottom)"/><path d="m416.341,281.975c0,.914-.354,1.809-1.035,2.68-5.542,7.076-32.661,12.45-65.28,12.45-32.624,0-59.738-5.374-65.28-12.45-.681-.872-1.035-1.767-1.035-2.68,0-.914.354-1.808,1.035-2.676,5.542-7.076,32.656-12.45,65.28-12.45,32.619,0,59.738,5.374,65.28,12.45.681.867,1.035,1.762,1.035,2.676Z" fill="url(#SandTop)"/>';

Expand Down Expand Up @@ -187,13 +190,13 @@ library SVGElements {
}

function hourglass(string memory status) internal pure returns (string memory) {
bool settledOrDepleted = status.equal("Settled") || status.equal("Depleted");
return string.concat(
'<g id="Hourglass">',
HOURGLASS_BACKGROUND_CIRCLE,
HOURGLASS_FILL,
status.equal("Settled") || status.equal("Depleted") ? "" : HOURGLASS_UPPER_BULB, // empty or filled with
// sand
HOURGLASS_LOWER_BULB,
settledOrDepleted ? "" : HOURGLASS_UPPER_BULB, // empty or filled
settledOrDepleted ? HOURGLASS_LOWER_BULB_LARGE : HOURGLASS_LOWER_BULB_SMALL,
HOURGLASS_STROKE, // needs to be declared last so that the stroke is painted on top of the sand
"</g>"
);
Expand Down

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions test/integration/basic/lockup-linear/token-uri/tokenURI.t.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/utils/Precompiles.sol

Large diffs are not rendered by default.