Generate spec inside view_static function
Fix dynamic plot rendering